This test was just too important to miss.

A student in France who crashed his father's car while trying to get to school to take an exam on Monday was able to get there in the nick of time thanks to the help of police.

The National Police of Tarn said on Facebook the 18-year-old named Loïc had already missed a bus and was so desperate to take his baccalaureate exam he took his father's vehicle.

ARCHBISHOP DONS HARD-HAT TO HOLD FIRST MASS IN NOTRE DAME SINCE DEVASTATING FIRE

But a few miles from reaching his destination, the 18-year-old lost control of the car and crashed into a guardrail on the other side of the road.

Police in the small town of Albi, located just north of Toulouse said on Facebook they arrived at the scene of the accident and found the teenager "unscathed."

The high school student was given a breathalyzer test for alcohol consumption -- which he passed -- before being taken to school with minutes to spare, according to police.

US DONORS HAVE BEEN FOOTING NOTRE DAME WORK BILLS INSTEAD OF FRENCH TYCOONS

Authorities said the teenager arrived to take the test with two minutes to spare, which "dumbfounded" his classmates.

The teenager said he was set on taking the exam, which is required for all students to graduate high school in France, according to the BBC.

CLICK HERE FOR THE FOX NEWS APP

Police said they wished the student "all the success he deserves."