A DARWIN teenager has been released from his weekend in prison, as police and court staff struggle to work out why he was there.

Curtis Fejo fronted the Darwin Magistrates Court on Monday but he faced no charges.

The ABC reports neither his lawyer nor Magistrate Alan Woodcock had any idea why Fejo was behind bars.

"Nobody knows why he's here," Ms Wild told the court.

Magistrate Woodcock said he did not know why Fejo was in custody and told the court security guard, "I should think he should be walking out of court now".

Mr Fejo is now considering legal action, according to the North Australian Aboriginal Justice Agency.