Tanzania's Prime Minister Edward Lowassa has tendered his resignation after being implicated in an energy deal corruption scandal.
Mr Lowassa told MPs his decision had not been an easy one
He has denied that his office was involved in improperly awarding a contract to US-based electricity company Richmond Development in 2006.
The firm failed to provide emergency power during a power crisis in 2006.
Following Mr Lowassa's announcement to parliament, two other ministers linked to the scandal resigned.
The BBC's Africa analyst Mary Harper says the offer of resignation from such a senior member of government for alleged links with corruption is unprecedented in Tanzania, and unusual in Africa.
But Tanzania has been getting more serious about corruption since President Jakaya Kikwete was elected in 2005.
Just last month, the governor of the central bank was sacked following the disappearance of public funds from the bank.
The BBC's Vicky Ntetema in Dar es Salaam says Richmond was contracted to bring in generators to provide 100 megawatts of electricity each day after a drought early in 2006 left low water levels in dams leading to severe power cuts.
But a parliamentary inquiry, launched in November, found that the generators failed to arrive on time and when they did, they did not work as required.
By the time the company was ready to start operations, Tanzania's power problems had been resolved.
Despite these failings, the government was contracted to pay Richmond more than $100,000 a day.
Mr Lowassa's office later influenced the government's decision to extend Richmond's contract despite advice to the contrary from the state-run energy company Tanesco, the inquiry alleges.
Richmond "lacked experience, expertise and was financially incapacitated", ruling party MP Harrison Mwakyembe, who headed the investigation, is quoted by Tanzania's Guardian newspaper as telling parliament on Wednesday.
Richmond transferred its tender to another company, Dowans, last year.
Mr Lowassa, who has denied any links to the scandal, has suggested the parliamentary committee investigating the energy deal was given the wrong information.
"I've thought long and hard about this issue. I've offered my resignation without any ill motive," he said in an emotional speech to parliament on Thursday morning.
"I've done it to as a sign of my responsibility and to register my disagreement with the manner in which the committee misled parliament."
Energy and Minerals Minister Nazir Karamagi and Ibrahim Msabaha - a former energy minister and now in the East African Community ministry - resigned on Thursday afternoon.
Our correspondent says Mr Lowassa, who entered politics in the 1980s, is a very close ally of President Kikwete.
But the president is likely to accept his resignation in light of public anger over the scandal, she says.
This is not Mr Lowassa's first brush with controversy.
Under President Ali Mwinyi, he was relieved of his duties as a land minister because of allegations of corruption - a scandal that reportedly infuriated Julius Nyerere, Tanzania's respected independence leader.