The Briton floored his American opponent with a peach of a right-hand counter and after Martin was knocked down again, the referee called a halt.
The 26-year-old is his country’s sixth bona fide heavyweight world champion.
Joshua is also just the third man to win a pro heavyweight world title while still a reigning Olympic champion.
And he is the first Briton to win both the super-heavyweight Olympic gold and a version of the world heavyweight title – London-born Lennox Lewis was fighting for Canada when he won the 1988 Olympic super-heavyweight title in Seoul.
Joshua’s victory now brings a super-fight against fellow Briton and WBA and WBO champion Tyson Fury a step closer.
Champion Martin, who was making the first defence of the title he won in January, entered the ring wearing a tall crown, a fur-trimmed, velvet cape and a smile as broad as his shoulders. But the smile soon disappeared.
Some thought previously unbeaten Martin, 29, would trouble Joshua with his southpaw stance – he was the first left-hander Joshua had faced in the paid ranks – but he barely threw a punch in anger.
It took Joshua half of the first round to find his range but when he did, he landed with three or four big right hands that appeared to rattle the champion.
The challenger staggered Martin with a sweet left hook early in the second, before a beautifully timed right put him on the seat of his pants.
Martin rose at eight but after another massive right put him down again, referee Jean-Pierre van Imschoot counted him out on his feet, one minute and 32 seconds into the round.
Remarkably, Joshua now has 16 knockouts from 16 pro fights and has only boxed 34 rounds in total. His only fight to go past three rounds was a seventh-round stoppage of Dillian Whyte last time out.
Joshua joins Ali in history books
Joshua joins Muhammad Ali and Leon Spinks as the only men to be professional heavyweight world champions while still reigning Olympic champions.
Ali, then known as Cassius Clay, won light-heavyweight gold in 1960 before dethroning Sonny Liston in 1964; Spinks won light-heavyweight gold in 1976 before dethroning Ali in 1978, in only his eighth paid fight.
While nobody has won a world heavyweight title faster than Spinks, Joshua surpasses Ali (20 fights), Lennox Lewis (22) and Mike Tyson (28).
Frank Bruno, Lewis, David Haye and Bob Fitzsimmons complete the list of Britain’s heavyweight world champions. Herbie Hide and Henry Akinwande were WBO title-holders when the belt was not taken seriously by many of the elite fighters in the division.
Joshua v Fury next?
The IBF belt was stripped from Fury when the Manchester boxer opted for a rematch with Wladimir Klitschko rather than a mandatory defence.
Should Fury beat Klitschko in their rematch on 9 July, a blockbuster meeting between the two Britons would be inevitable.
Also in the mix is former heavyweight world champion Haye, who returned to the ring with a first-round knockout of Mark de Mori in January and fights again next month.