Tanzania's election commission has declared ruling party candidate John Pombe Magufuli as the winner of the country's presidential election.

The election commission announced Thursday that Magufuli of the Chama Cha Mapinduzi (Revolutionary Party) had won with 58 percent of votes. His rival, Edward Lowassa of the Chadema party, got 40 percent.

Magufuli has been serving as public works minister in the government of the outgoing president, Jakaya Kikwete. Lowassa, who served as prime minister from 2005 to 2008, used to belong to the ruling party but defected earlier this year after failing to become its presidential candidate.

Lowassa said Wednesday he is disputing some results and wants a recount.