Khwaja Sharif, chief justice of the Lahore High Court, said the five men would remain in Pakistan pending further investigation, Pakistani English-language newspaper Dawn reported.
Sharif also ordered any future deportation cases be referred to the High Court.
The five men arrested in Sargodha, near Lahore, were going to terrorist safe havens to train to fight against U.S. troops in Afghanistan, Pakistani police said last week when the men were detained.
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'
Beyonce flaunts bikini body, Blue Ivy in vacation pics