Opposition candidate Peter Mutharika has been declared the winner of Malawi's disputed presidential election.
The leader of the Democratic Progressive Party obtained 36.4% of the vote, the electoral commission announced.
A protester died earlier after police dispersed an angry crowd demanding a recount of last week's ballot.
Outgoing president Joyce Banda has alleged the vote was rigged.
'Law is clear'
The Malawi Electoral Commission (MEC) had asked for a 30-day extension to declare the results so that a recount could be carried out.
However, the High Court refused to delay the release of results and ordered the commission to make its announcement on Friday.
"The law is clear, there is no extension," judge Kenyatta Nyirenda said.
Mr Mutharika is the brother of the late President Bingu wa Mutharika, and had served as his foreign minister.
Former preacher Lazarus Chakwera came second with 27.8% of the vote. He represented the Malawi Congress Party, which governed from independence in 1964 until the first multi-party poll in 1994.
Mrs Banda, who came to power after the death of Bingu wa Mutharika two years ago, was third with 20.2% of the vote.
Her administration had been hit by a corruption scandal dubbed "cashgate", which led donors to cut aid.
Malawi is one the poorest nations in the world and is heavily dependent on aid, which provides 40% of the country's budget.
About 7.5 million people were eligible to vote in the elections, which was described as Malawi's closest-fought poll in 20 years.
The election was chaotic, with many polling stations opening up hours late and frustrated voters setting one polling station alight.
The electoral commission said that in 58 of more than 4,000 polling centres the official number of votes cast was more than that of registered voters.
Last week, Mrs Banda accused a party, which she did not name, of infiltrating and hacking the electronic system that transmits the results to the MEC's headquarters.
The MEC's chairman denied that its system had been hacked.