Reece Kidd strayed into the pariah state by accident while on a boat trip in China, despite Foreign Office advice to stay clear.
Tensions between North Korea and the West over its nuclear programme have pushed the region to a heightened state of alarm.
Foreigners crossing the border have run into trouble in the past but the 22-year-old later joked that the country was “pretty chill” after border guards allowed his boat to depart without detaining them.
Reece, from Northern Ireland, was in China as part of the Saltire Scholar programme, which gives talented young people subsidised work placements overseas.
He said he wanted to visit North Korea, saying it seemed to be a “hip place” to visit.
He said he took a speedboat trip with a Chinese family on the Yalu river, with the boat eventually approaching a guard tower on the other side.
The Stirling University student posted an account of his trip on the website of Entrepreneurial Scotland, which organised a placement for him at Fidelity Investments in the Chinese city of Dalian.
The blog post, which has now been deleted, stated: “I accidentally crossed the North Korean border.
“Took a weekend break to Dandong, China, which is right beside North Korea.”
“I was just enjoying the sun when the driver turns around the corner and we go right along the guard tower. I see some soldiers in the distance, resting beside the water.
“We drive right along beside them before pulling over. They are North Korean uniforms.”
The student, who is blonde, realised his hair would instantly mark him out as a foreigner.
He added: “Two thoughts go through my head. First, I don’t want to be trapped in a North Korean prison. Secondly, I should have worn a cap.”
A spokesman for Entrepreneurial Scotland said Mr Reece’s actions had been “naive”, and did not reflect the standards of the programme.
He added the student had apologised, and now understood the danger his lack of judgement may have placed him in.
The Foreign Office advises against all but essential travel to North Korea.