A team of Pakistani footballers on a rare tour to Afghanistan were arrested and had their heads shaved as a punishment for wearing shorts, a violation of the Islamic code laid down by the Taliban government.

The players from the Young Afghan Club, based in the border town of Chaman, in western Pakistan, were dressed in a red strip and shorts for the invitation tour, the first visit by a Pakistani team since the Taliban took power four years ago.

Halfway through their third and final game against a local team in Kandahar on Saturday, armed Taliban religious police burst into the sports stadium and stopped the match.

The team manager and some of the reserves fled but 12 players were arrested. The raid started a stampede among the hundreds of spectators and several were injured.

After a night in the city jail, the players had their heads shaved, a mark of shame usually reserved for petty thieves, and the men were sent home.

Mohammed Hasan, the Taliban's Kandahar governor and one of the regime's most senior leaders, admitted the police had over-reacted. "They were our guests and should not be treated like this," he said.

Under Taliban rules and despite the burning summer heat, the players should have been more modestly dressed in the traditional shalwar kameez, baggy trousers and long-sleeved shirt.

All Afghan men must also wear turbans and uncut beards or risk a public beating from the religious police. Women are rarely allowed out of their homes and when they venture on to the streets they must wear all-covering cloaks, burqas. Western-style clothes and haircuts are forbidden.

More than 20 years of war and four years of Taliban rule have put pay to most organised sport in Afghanistan, one of the few countries not to put forward a team for the Olympics or the next World Cup.

The Taliban have taken to using the crumbling brick football stadiums of Kabul and Kandahar for public executions and mutilations.