The Lewis and Clark County bomb squad works the scene at Rossiter Elementary School in Helena, Mont.

HELENA, Mont. — Authorities evacuated an elementary school in Montana on Tuesday after officials found what they thought were the remnants of a homemade bomb that exploded, but it turned out to be a plastic bottle filled with nuts and bolts left in the schoolyard.

School officials in Helena made the discovery shortly before classes began at Rossiter Elementary School. They blocked off the area and called 911, Lewis and Clark County Sheriff Leo Dutton said.

An investigation found the plastic bottle wrapped in black electrical tape was full of washers, nuts and bolts, along with a non-flammable unidentified liquid, Dutton said. There was no detonator.

A homeless person found the bottle at a construction site and left it at the playground, Dutton said. No threat had been made against the school, and there were no injuries or damage.

“Pretty much it’s solved,” Dutton said. “We know who put it there and it wasn’t malicious. It did look like a bomb. The school acted appropriately.”

The 490 students walked to a nearby location where they could be picked up by their parents, Superintendent Tyler Ream said. School buses kept them warm.

Police closed the school and searched the grounds for additional devices. Thousands of students across Helena and East Helena were kept inside while authorities did the sweep, authorities said.

Searches also were conducted at the state Capitol and government buildings, Dutton said.

Deputies who responded to the 911 call initially believed it was a bomb, Dutton said. “They were looking at a debris field, what looked like a debris field,” he said.

“It wasn’t until we could get the bomb squad in there and the evidence team that we learned exactly what it was,” Dutton said. “You wouldn’t expect any patrol deputy to pick it up and look at it and possibly injure himself or others.”

Classes were scheduled to resume Wednesday, said Ream, who planned to meet with teachers and staff to discuss how they would explain the events to the children.

“The really important message is if you see something and you don’t think it’s safe, tell somebody,” Ream said, adding it may be difficult to explain the initial concern to a 5-year-old.

Helena is a small city of about 30,000 people in the foothills of the Rocky Mountains. The school is in a neighborhood just north of the city’s center.