The president failed to get Mr Mahsuli appointed as oil minister in 2005
Iranian MPs have narrowly approved President Mahmoud Ahmadinejad's choice for interior minister, two weeks after sacking his predecessor for deception.
The new minister, Sadeq Mahsuli, is one of Mr Ahmadinejad's closest aides.
He won the vote of confidence by the margin of 138 votes to 112 with 20 abstentions, officials said.
In 2005, Mr Mahsuli was the president's controversial pick as oil minister. But he withdrew because MPs objected to his lack of experience in the sector.
Earlier in November, MPs voted to sack Ali Kordan as interior minister for lying about his credentials and presenting a fake degree from Britain's Oxford University.
Mr Mahsuli is, like Mr Ahmadinejad himself, a veteran of Iran's elite ideological army the Revolutionary Guards, which correspondents say has been steadily encroaching on national politics in the Islamic republic.
Reports of the proceedings say the debate over his nomination was heated, focusing on Mr Mahsuli's personal wealth and his ties to Mr Ahmadinejad.
"Sadeq Mahsouli has to come clean and tell the deputies about the origin of his fortune," said MP Hassan Vanaei.
"The mixture of wealth and power is dangerous for a minister," said Heshmatollah Felahatpishe.
However, Mr Mahsuli's supporters said he led a simple life and did not have lavish tastes.
Graduate in engineering and business studies
Former governor of Orumiyeh
Revolutionary Guards veteran
Some MPs were concerned about the close relationship between the candidate and the president, because in Iran the interior ministry is responsible for organisations elections. Mr Ahmadinejad faces re-election next year.
Mr Ahmadinejad told MPs that Mr Mahsuli would be a "strong" leader of a ministry that had become "shaky".
Analysts said the close vote showed how serious the differences have become between the president and the conservatives who dominate parliament.
Mr Mahsuli is an engineering and business graduate, who previously served as governor of Orumiyeh in western Iran and as a deputy defence minister.
He was also an adviser to the Expediency Council, which arbitrates in disputes between parliament and the powerful clerical body the Guardian Council.
He was relatively unknown before the controversy about his nomination as oil minister.
He was Mr Ahmadinejad's second choice for that important role - Iran is the world's fourth biggest crude oil producer. MPs also rejected the first for lack of experience.