BUTTE, Mont. (AP) — A state judge has given Butte-Silver Bow County the authority to demolish what's left of a five-story warehouse that partially collapsed last June and caught fire over the weekend.

The Montana Standard reports (http://bit.ly/1Ivt2vD ) District Judge Loren Tucker issued his ruling Thursday, saying the county's plan was "complete and appropriate," while one filed by building owner Neil "Joe" Lynch Jr. was not.

The county sought to demolish the building after the partial collapse and require Lynch to pay for the work. Lynch argued a broken water main in an adjacent building damaged the warehouse and the city-county government was partially responsible. Tucker's ruling did not say who was responsible for the demolition costs.

A fire that began burning in the rubble on Friday flared up on Sunday morning and again on Tuesday morning, causing more of the building to collapse.