"Mkapa was found with malaria and he was admitted for treatment since Wednesday," family member William Erio revealed during a funeral mass broadcast on state television TBC1.
Mkapa, who ruled the East African country for two terms from 1995 to 2005, died early Friday aged 81 in a Dar es Salaam hospital but the government did not reveal the cause of the death.
"He was feeling better on Thursday and I was with him until 8:00 pm that day," Erio said.
"After watching the evening news bulletin, he died of cardiac arrest," Erio added, saying he wished to dispel rumours spreading on social media that Mkapa had contracted the new coronavirus.
President John Magufuli attended the funeral mass along with his vice president and prime minister at the national stadium.
The opposition has accused Magufuli's government of a lack of transparency regarding its handling of a pandemic which the president said last Monday was no longer present in the country as he urged tourists to return.
Tanzania ceased publishing official statistics on the virus on April 29 and, unlike its neighbours, has taken no specific measures designed to halt its spread.
Officially, Tanzania has logged a mere 509 COVID-19 cases to date whereas neighbours such as Kenya and DR Congo have respectively registered more than 16,000 and more than 8,000.
Questions arose over Mkapa's cause of death after Magufuli did not immediately make an official announcement on the time, place and cause in line with 2006 legislation.
Mkapa, who was the country's third president after independence from Britain in 1962, will be buried in his home village in the southeastern region of Mtwra on Wednesday.
After leaving office he remained active, taking part in mediation talks in Kenya after 2007-08 election violence.
He also attempted, unsuccessfully, to mediate between Burundi's government and opposition groups after a disputed 2015 election plunged the country into crisis.