A van narrowly avoided an oncoming train in Virginia during an incident that is being described as a "miracle." 

Video of the close encounter captured by Bob Brown in South Boston shows a van with the Pepsi logo accelerating across the tracks just moments before the train passes through. 

"It was a miracle that he made it," Brown told The Gazette-Virginian newspaper, which reported that the driver, identified as 53-year-old Tommy Cobbs of Danville, escaped injury. 

Cobbs has since been charged with failure to obey signs and markings, the newspaper added, citing the Virginia State Police. 

CAR CRASHES THROUGH ARIZONA HOME AS COUPLE WAS ABOUT TO SIT FOR DINNER 

Virginia train collision near-miss

The incident in South Boston, Virginia, on July 13 began when the van crashed through a lowered railroad crossing gate. (Bob Brown via Storyful)

The video, which was taken on July 13, begins with the van braking as it heads toward a lowered railroad crossing gate. 

However, the van plows through the gate and comes to a stop right before the tracks, as the train can be seen approaching in the distance with its horns blaring. 

The driver then backs up and appears to hit the gate a second time before the vehicle starts to move forward again. 

TODDLER KILLED IN OCEAN CITY, MARYLAND TRAM CRASH WHILE CROSSING BOARDWALK 

Virginia train almost strikes van

The train is seen fast approaching the van, which has yet to clear the railroad tracks in South Boston, Virginia. (Bob Brown via Storyful)

Just before it appears that the train will strike the van, a quick burst of acceleration allows the vehicle to get to the other side of the tracks safely. 

The train eventually comes to a stop shortly following the incident. 

The incident caused about $2,000 in damage to the crossing gate, according to The Gazette-Virginian. 

Van in Virginia avoids being hit by a train

The incident ended with the van crossing the tracks, avoiding a collision. (Bob Brown via Storyful)

CLICK HERE TO GET THE FOX NEWS APP 

"Based on the speed of the train and the speed of the van, I thought we were going to see crumpled metal or worse, but he made it," Brown said.