Motlanthe is expected to act as a caretaker president until elections in April 2009.
Reflecting the ANC's dominance of parliament, Motlanthe won 269 votes from members of parliament, compared to 50 for the candidate of the opposition Democratic Alliance.
ANC parliamentarians greeted the announcement of the vote with cheers and clapping.
His election had been more or less certain, Jane Dutton, Al Jazeera's correspondent in Cape Town, said, given the ANC's vast majority in parliament.
She said that "when members of the opposition put their names up [for election] members of the ANC booed and jeered" because the vote was seen as "a forgone conclusion".
Mbeki's resignation came after a court threw out corruption charges against ANC leader Zuma, saying that the prosecuting team had violated some of his procedural rights.
Mbeki said the government "never compromised the right of the national prosecuting authority to decide whom it wished to prosecute or not to prosecute".
Even so, he came under pressure from inside the party to resign and eventually stepped down, paving the way for Motlanthe to be elected as a caretaker.
The upheaval in the ANC has raised concerns of a possible split in the formerly monolithic ruling party.
In a sign of the wounds, parliamentary officials said Mbeki would not attend Motlanthe's swearing-in later on Thursday despite being invited.
But Nic Borain, a political analyst, told Al Jazeera, that Motlanthe was considered a good compromise candidate to lead South Africa into the next election.
"He's very much a caretaker candidate waiting for Jacob Zuma to take over next year ... he's a steady hand," he said.
"He's seen as very presentable and gives exactly the right image to the markets and, as a representative of the whole of South Africa, he is an entirely appropriate candidate."
Asked about fears by some within the ANC that Motlanthe might turn out to be a rival to Zuma in next year's elections, Borain said: "That's always been something attributed to him mostly by the ANC Youth League ... I think he's a loyal Zuma person."
"In a real way Zuma is the ANC's candidate and Kgalema Motlanthe doesn't have a constituency within the ANC anything like as powerful or as significant as Zuma has."