A federal judge has closed out the bankruptcy case filed by a Southern California city that grappled with a dire cash shortage a decade ago, officials said Monday.

The city of San Bernardino said in a statement that U.S. Bankruptcy Judge Scott Clarkson closed the case last week because the city had resolved claims and has shown it can pay its outstanding long-term obligations. When the city filed for bankruptcy on Aug. 1, 2012, vendors hadn’t been paid and cash was running out to make payroll.

“The grueling and deep cuts we all experienced are in the rearview mirror of San Bernardino’s history,” Mayor John Valdivia said.

Officials said the city of 220,000 people some 60 miles (97 kilometers) east of Los Angeles is now in a much better financial position and has been tackling street paving and tree trimming projects and hiring much-needed staff.

For the current fiscal year, the city has forecast a $2.5 million budget surplus — a far cry from the $45 million budget shortfall that was projected when the city entered bankruptcy, the statement said.

A decade ago, San Bernardino was in tough financial straits thanks to weak property and sales tax revenues, rising pension costs and a decline in state redevelopment funding. It went into bankruptcy amid an unprecedented wave of cities doing so, including Vallejo, California, and Detroit.

In 2017, San Bernardino began paying creditors again under a bankruptcy exit plan approved by the judge. At the time, there were more than 1,000 claims against the city.

Editor’s note: This story has been corrected to show the city’s population is 220,000 not 22,000.