It was a plan that could have come straight from Mission Impossible. But two Kentucky students were left looking less Tom Cruise and more Mr Bean when their alleged bid to steal an exam paper ended in embarrassment.

Police say it was late at night on Tuesday (2 May) when one of the pair clambered into a university building air duct, crawled to above his professor's office and dropped into the room from the ceiling above.

Officers say he then unlocked the door to let in another student to help search for the statistics exam paper.

What the duo hadn't counted on was their University of Kentucky (UK) professor being a night owl – catching them in the act as he worked late.

Police said statistics lecturer Prof John Cain had been in his third floor office in the university's Multidisciplinary Science Building when he left to get something to eat at about midnight.

He returned about 1.30am but found the door blocked as he tried to unlock it, soon realising someone was inside.

"He yelled out that he was calling the police and then the door swung open and two young men ran down the hallway," university spokesman Jay Blanton told the Lexington Herald-Leader.

Shortly after police arrived to investigate the suspected burglary, one of the students returned to confess.

Henry Lynch II, a 21-year-old junior majoring in biosystems engineering, revealed he had been the one to climb through the building's air ducts to the ceiling above Cain's office – a plan hatched after an earlier attempt to steal the exam paper failed.

He said he dropped down into the room and unlocked the door to let in his friend, Troy Kiphuth, a 21-year-old sophomore not said to be in Cain's class.

Lynch also allegedly confessed to successfully stealing another paper earlier in the semester, but said he did not share answers with other students.

Both students are now expected to face third degree burglary charges when they are referred to Fayette Circuit Court.

Blanton said the matter has also been referred to the university's Office of Student Conduct, which will now conduct a formal investigation.

"The Office of Student Conduct takes this matter very seriously and it will be reviewed extensively to make a determination and we will act accordingly," Blanton said.