An American bulldog followed a group of elementary students onto a Prince George’s County school bus Wednesday morning and attacked without warning, injuring four children, police and a witness said.

The bus driver hit the dog as it bit one child in the thigh, and the animal loosened its grip. A Prince George’s police officer, unable to restrain the dog when it ran outside, shot and killed it as the children on the bus watched, officers said.

Four elementary school students were treated for scratches and bites, authorities and witnesses said.

“It was a very ugly morning for these children,” said Sonya Ray, a parent who witnessed some of the events and whose 11-year-old son was among those bitten. “They were terrified.”

The incident began about 8 a.m. in the 12300 block of Windbrook Drive in Clinton, authorities said. The students were on their way to Fort Washington Forest Elementary School, a Prince George’s schools spokesman said.

Rishon Ray, Sonya Ray’s son, said he and his friends spotted the dog roaming free — without a collar or tags — as they were walking to the bus stop. He said it did not harm anyone at first, and one of his friends said it was friendly.

The dog soon began acting strangely, Rishon Ray said. He said it followed students onto the bus through the vehicle’s open doors and bit several of those inside. He said it then charged outside at him, biting him and chasing him as he ran onto the bus.

Rishon said the dog eventually clamped down on his thigh and would not let go.

“He was terrorizing the bus,” Rishon said. “Everybody was so frightened.”

Rishon said the bus driver hit the animal until it released his leg and ran off the bus. Rishon called his mother, who lives nearby.

“It was really the bus driver who saved all the kids, especially me,” Rishon said.

Sonya Ray said that she arrived to see the dog try to attack another boy who was running for an ambulance with his mother. She said she tried to get the boy to safety in her truck, and the bus driver ran over and kicked the animal away from the boy.

A Prince George’s officer shot and killed the dog, which was still behaving aggressively, Sonya Ray and a police spokesman said.

“He didn’t have a choice,” Sonya Ray said.

Sonya Ray said her son sustained several deep bite wounds, and she was still waiting to hear whether the dog had any diseases. Rodney Taylor, chief of animal management in Prince George’s, said that the dog would be tested Thursday morning but that it did not show any signs of being rabid.

Taylor said investigators were trying to find the dog’s owner Wednesday. He said the dog was a male and weighed about 120 pounds. He said the owner could face civil fines for letting the dog run at large and other penalties if it was unlicensed.

Staff researcher Eddy Palanzo contributed to this report.