Ōamaru is preparing to officially reopen its courthouse on Thursday after years of fighting to keep its justice services.
The 135-year-old courthouse was closed in December 2011 after being deemed earthquake-prone.
The future of the courthouse looked dire when a government engineering report found strengthening could cost upwards of $4 million.
Faced with remedial costs in the millions and people travelling outside the district for court, the community banded together to save the historic landmark and its services.
The town's court services were held in its opera house before being set up in a port-a-court in a local hotel car park.
But lawyer Bill Dean said that facility was not big enough to cater to all services, forcing some locals to have to travel more than an hour away to a court in Timaru or Dunedin.
He called the fight to keep court services in Ōamaru "a David and Goliath" situation.
"This is a very strong Ōamaru stone building, it's using blocks of stones about the size of an armchair," Mr Dean said.
"Initially the figure of $4m-6m was going to make it very difficult to retain the court. Under those numbers, it was probably going to be a case of 'Well, we'll just shut it down.' "
But instead of feeling defeated, Mr Dean did his own research - employing an engineer to assess the courthouse then asking for a price on the proposed repairs.
The cost was closer to $350,000 - and the assessment found the building was unlikely to collapse in an earthquake and did not need to be closed in the first place.
But Mr Dean said it took several years for the paperwork to be accepted and remedial work to be completed.
He was in the process of retiring, but said the courthouse needed to be saved for the community's sake.
"The Ōamaru Court is very important for my career. It's been the court I've appeared in ever since I've been in practice. I would have hated to see it shut and fall into disrepair."
Waitaki District Council mayor Gary Kircher said the community was jubilant the courthouse would reopen and offer justice services once again.
In the end, the council paid $900,000 to strengthen and refurbish the building, which Mr Kircher said was money well-spent.
"It absolutely has been a community effort."
Waitaki District Archives curator Chris Meech said the courthouse harkened back to Ōamaru's riotous early days, where more than 13 percent of the town's population appeared in court.
"It was called a drunken metropolis and the best crime producing district in Otago."
When built, the courthouse cost close to £3000 - roughly $524,000.
"When Forrester and Lemon completed the construction of this building, I think they left something that town has really taken into its character," Mr Meech said.
Justice Minister Andrew Little will officially open the building tomorrow at 10am.
There will be a tour of the building on Saturday.