Two brothers who were arrested at the U.S.-Canada border last fall and charged with committing a hoax related to terrorist activity were released from custody Friday.

Bailey Roy, 21, and Damien Roy, 22, both pleaded guilty in a Woodstock, N.B., courtroom to a charge of obstruction and were sentenced to time served.

The Crown dropped the terrorist hoax charge.

Judge David Walker called the incident "stupid" before wishing the two brothers from the Halifax area "good luck."

In an agreed statement of facts, Crown prosecutor Brian Munn read aloud details of the bizarre series of events that led to the Roy brothers being arrested.

Bailey Roy entered the Woodstock provincial courthouse Friday morning wearing handcuffs and leg cuffs, but left a free man after being sentenced to time served. (Shane Fowler/CBC)

The day before their Oct. 26 arrest, the brothers bought a blue 1967 Buick Skylark. Although they didn't have legal documents for the car, the brothers planned to drive it to Mexico without having to stop at any U.S. gas stations.

They filled 21 jugs with gasoline, which they placed in the back seat of the vehicle and in the trunk.

The brothers had no GPS, so they plotted their route using paper maps. Having no passports or IDs, the two planned to cross the border into Maine illegally, apparently by using a road without a border checkpoint.

Instead, they found themselves at the Houlton-Woodstock border crossing, one of the largest checkpoints in the province, west of Woodstock, N.B., and east of Houlton, Maine.

Realizing their predicament, Bailey, who was driving the Skylark with no plates or tags, and his brother, who was in the passenger seat, "froze," Munn said.

Damien Roy followed his younger brother into the courthouse. Both men pleaded guilty to obstruction. (Shane Fowler/CBC)

At 10:05 a.m., within view of the border checkpoint but still on Canadian soil, the brothers stopped "basically in the middle of the road."

That prompted two officers with the Canada Border Services Agency to approach the Skylark in a marked vehicle with lights and sirens on.

One officer tried to communicate with the brothers, asking if they were OK, but got "absolutely no response," Munn said.

The men just stared straight ahead.

The officer attempted to open the driver's side door but found it locked.

This is the 1967 Buick Skylark the brothers were driving before they were arrested. With the back seat and trunk filled with jugs of gasoline, the brothers say they planned to drive the vehicle to Mexico without having to stop at any U.S. gas stations. (John Slipp)

At that point, the two CBSA officers noticed the gas jugs in the rear of the vehicle and retreated.

Then the RCMP, U.S. border officials, a U.S. drone and police dogs got involved. The border crossing was shut down for 12 hours, and all traffic was barred from entering or leaving.

For 6½ hours, officers tried to figure out what was happening with the two men and the Skylark full of gas jugs. During that time, neither Bailey nor Damien Roy responded to police attempts to communicate.

"They did not move," Munn said.

Eventually, Bailey Roy drove the car toward the border crossing and stopped. Both men then exited the vehicle using the passenger's side door.

They were arrested by U.S. border officials. Bailey was turned over to Canadian officials within 24 hours, but Damien tried to claim asylum in the U.S., which resulted in his detention there for about a month before he was handed over to Canadian authorities.

A search of the the brothers' car turned up maps, food and 21 jugs full or nearly full of gas — nine in the back seat, 12 in the trunk.

The Roy brothers left the courthouse Friday morning wearing the clothes they had on when they were arrested in October. (Shane Fowler/CBC)

Munn said that in interviews, the brothers claimed they had no intention of committing a terrorist act and no political motivations.

"To use the words of Bailey Roy himself during an interview, essentially what they had done was 'stupid,'" Munn said.

Neither brother had a criminal record.

"The Crown is recommending a sentence actually less than the time they served in custody at this point," Munn told the judge. "Between three to four months would be appropriate.

"This was more stupid than it was criminal."

Both men declined to address the court before Walker sentenced them to three months in jail, resulting in their immediate release because of time already spent in custody.

Damien Roy did ask about the whereabouts of the Buick Skylark, and Munn said the car was still in Maine and out of the court's hands.

"You probably didn't pay that much for it anyway," Walker told Roy.

The brothers then left the courthouse, looking for a way back to their mother's home in Halifax. They were wearing what they had on when they were arrested in October: gym shorts, sneakers and sweatshirts.

"No comment," Damien Roy repeated when CBC News asked the brothers how they were feeling about the ordeal.