After Rajapaksa arrived, Weerawansa was taken away in an ambulance. Hunger strikes are a common tactic to bring attention to a cause in Sri Lanka and south Asia, but rarely end in death.
Sri Lanka's relations with the world body and Western nations have been strained since it destroyed the separatist Tamil Tigers and won a 25-year conflict in May 2009, a victory that drew military praise but equal criticism over civilian deaths.
Weerawansa has been laying in front of the U.N. compound since Thursday, two days after police tried to escort trapped U.N. staff out until the minister got the president's brother, Defence Secretary Gotabaya Rajapaksa, to stop the officers.
Ban reacted angrily to the protest, recalling the U.N. country chief for talks and ordering the immediate closure of a regional U.N. office sited in Colombo, which local U.N. staff said had already been downsized for a planned move.
On Friday, the United States, European Union and seven European countries said the government's handling of the protest could harm its international reputation.
Ban's appointment of a three-member panel to advise him on "accountability issues" sparked fury from the government, which views the action as a prelude to the full probe demanded by human rights groups over thousands of civilian deaths.
Rajapaksa blames the West for applying double standards to Sri Lanka's fight to destroy a group on U.S. and EU terrorism lists. The government says Ban's panel violates its sovereignty, because it has its own commission probing the war.
Sri Lankan allies Russia and China both have criticised the panel as unnecessary. Rajapaksa denies soldiers committed any crimes and says the casualty figures are inflated.
Ban insists the panel is merely to advise him on international best practices for post-conflict reconciliation, and has no investigative mandate.