Campaigners have lost their legal bid to stop the reorganisation of hospital services in Dorset.
Dorset Clinical Commissioning Group (CCG) agreed changes, including the closure of Poole's A&E, last October.
Defend Dorset NHS brought a judicial review against the proposals, claiming longer travel times for emergency care would risk patient safety.
However, a High Court judge has ruled in favour of the CCG. Defend Dorset said it was considering its next move.
The group, which crowdfunded the challenge, has 21 days in which to launch an appeal.
During a hearing at London's Administrative Court in July, lawyers argued health bosses were not informed about the risks arising from moving emergency services out of Poole Hospital.
Under the plans, its A&E, maternity and paediatric services will be lost to Bournemouth, which will become the area's main emergency hospital.
Poole is set to become a centre for planned treatment and operations.
Changes to mental health acute care include the closure and relocation of beds at Weymouth's Linden unit and the creation of extra inpatient beds at St Ann's Hospital in Poole and Forston Clinic near Dorchester.
At Portland Hospital, 16 were beds closed last month as part of the reorganisation.
'Considerable legal cost'
The changes are designed to tackle a projected funding shortfall of £158m by 2021, according to the CCG.
Chief officer Tim Goodson said: "We hope that the High Court's decision will reassure local people that the CCG has acted properly and in the interests of healthcare services in Dorset."
He also said the changes would enable more non-emergency services to be provided closer to people's homes.
The judicial review has involved "considerable cost" to the NHS, he added.
In his final judgement, judge Sir Stephen Silber said: "I appreciate that some residents of Dorset will be disappointed by this decision, but it might be some compensation for them to know that the claimant's case has been very well argued, as has the case for the CCG."