Personnel from the Royal Navy, RAF and Army are to march out of Royal Haslar Hospital for the last time.
Medical care has been provided at Royal Hospital Haslar since 1753
A flag-lowering ceremony will be held at the Gosport, Hampshire, centre which will be handed over to the NHS after 250 years as a military hospital.
The country's last military-run hospital is to shut completely in 2009.
A military-managed ward at Birmingham's Selly Oak Hospital has been set up in the wake of criticism of the treatment of service personnel on civilian wards.
Royal Hospital Haslar, the last of eight military hospitals to close following a review of services by the Conservative government in the 1990s, has provided medical care since 1753.
The government has said military-run hospitals cannot match the specialist care provided by NHS hospitals.
Selly Oak Hospital has provided medical care for medical evacuees from Iraq and Afghanistan.
A dedicated ward was set up after soldiers complained of the trauma of being quizzed by civilians instead of recovering with colleagues after sustaining wounds in conflict.
Army general Sir Richard Dannatt told the BBC conditions had improved at the hospital following reports from families of soldiers that they were being neglected and treated in poor conditions.
Sir Richard said: "There was an issue, we have responded to it, it is getting better.
"And it's really important that message goes across because it potentially affects morale of soldiers on the front line."
'A terrible mess'
Peter Viggers, Conservative MP for Gosport, said: "No-one denies that Selly Oak can provide good medical care.
"What I say is that there remains a place for a dedicated military hospital which can support care in a military environment and help recuperation.
"It is a tragedy and a mistake that the Ministry of Defence is to withdraw from our only military hospital, the Royal Hospital, Haslar.
"Everyone knows that defence medicine is in a terrible mess and this withdrawal is making it worse."
The flag lowering service will mark the departure of the Commanding Officer at Haslar, Royal Navy surgeon Captain James Campbell.
Responsibility for the hospital will be handed over to Portsmouth Hospitals NHS trust, until services move to Portsmouth's Queen Alexandra Hospital in 2009.