An out-of-control school bus carrying 11 students in northeastern Minnesota had to be stopped by police after the driver allegedly suffered a medical emergency while driving.

All 11 kids, aged from 6 to 14 years old, were confirmed to be safe after some quick-thinking by police authorities managed to stop a runaway school bus in Aitkin County, Minn., on Wednesday afternoon, Taking Action reported. The incident, which lasted about 14 minutes and covered about 5 1/2 miles, occurred after the students had finished a school day in Isle, Minn., and were on their way home.

Around 3:49 p.m. on Wednesday, an Aitkin County Deputy on patrol spotted the bus traveling at a very slow speed while heading north on Highway 47.

"She first saw the vehicle weave within its lane a little bit. She thought that's not right. She turned her lights on trying to stop it and the weaving became more pronounced," said Sheriff Scott Turner.

After alerting authorities about the situation, the deputy began to follow the bus and noticed it was swerving and weaving between the northbound and southbound lanes. Immediately activating the emergency lights in order to stop the bus, the deputy continued to follow the vehicle when it failed to come to a halt.

As the school bus weaved back and forth between 35 and 40 mph, the deputy followed the bus, often times driving in the opposite lane to warn oncoming motorists, according to wfmynews2.com.

A number of oncoming drivers were forced to take evasive action, one speeding in reverse before finding a place to leave the road. At one point, the bus stopped in the middle of the highway and when the deputy approached on foot, the bus drove away again.

As the runaway bus continued its journey, a student abroad the bus managed to contact 911 and report that 68-year-old Scott Gilbertson could be going through a medical condition. The emergency door at the back of the bus was seen opening at one time like students were going to jump out, but it closed again.

Shortly after 4 p.m., the bus ended up in a shallow ditch in Glen, about 12 miles southeast of Aitkin, after a Minnesota State Trooper put down a tire deflation device to halt the bus.

While none of the students were injured, the bus driver was taken to the Riverwood Health Care Center in Aitkin for observation.

But authorities have still not released what type of medical situation had occurred, KHOU.com reported.

The dashcam video of the runaway school bus can be watched here.