Cedella Roman, 19, who was visiting her mother in British Columbia, decided to run along the beach that leads to Canada’s border with the United States on 21 May.
Ms Roman told Canadian media she turned on to a dirt path for a few metres as the tide rose, and stopped to take a picture before retracing her steps.
She was then confronted by two US border patrol agents who arrested her for crossing into Blaine, Washington.
“He started telling me that I had crossed the border illegally and I told him I really did not do it on purpose,” Ms Roman told Radio-Canada (in French).
‘I realised it was really serious’
The French national thought that she might be given a warning or, at worst, be fined.
“I did not think they would put me in jail,” she said.
But to jail she did go, as the officers took her more than 220km (136 miles) south to the Tacoma Northwest Detention Center, a privately run immigration prison in Washington state.
With no identification on her and just the clothes she was wearing, Ms Roman started to realise the gravity of her situation.
“They asked me to remove all my personal belongings with my jewellery, they searched me everywhere,” Ms Roman told the Canadian broadcaster CBC. “Then I understood it was getting very serious, and I started to cry a bit.”
She said she was held in a room with about 100 other people.
“We were locked up all the time and in the yard there was barbed wire and dogs,” she told French news agency AFP.
“We tried to help each other, there was a good atmosphere.
“Seeing people who had come from Africa and elsewhere locked up for trying to cross the border, it put my experience into perspective.”
She was allowed to contact her mother, Christiane Ferne, who came to the detention facility with Ms Roman’s passport and work permit.
But US officials would not let her leave until Canadian immigration authorities first confirmed she was allowed back into the country.
Both sides eventually agreed she could return to Canada, but only 15 days after Ms Roman first set off on her jog.
ICE confirmed timeline of events in a statement:
May 21 Roman detained and brought to detention center
May 24 ICE receives Roman's travel docs
May 29 Canadian border officials inform ICE they are willing to determine if she can reenter Canada
June 5 Roman is removed to Canada https://t.co/eMzK5iXq0H— Eva Uguen-Csenge (@evacsenge) June 23, 2018
Official documents by US Immigration and Customs Enforcement obtained by CBC confirmed Ms Roman’s detention and that she was returned to Canada on 6 June.
Immigration officials on both sides of the border declined to comment on the French national’s case, citing privacy concerns.
A spokesperson for US Customs and Border Protection said that anyone crossing into the country outside an official port of entry was breaking the law and would be processed accordingly.
“This regulation applies even if the individual claims to have inadvertently crossed the border,” they said in a statement.