Socialite Paris Hilton took some of the spotlight from the World Cup after she was arrested on suspicion of possession of marijuana, then had the case dropped at a midnight court hearing.

Hilton appeared in a FIFA World Cup courtroom after being arrested during the second half of the quarter-final match between Brazil and the Netherlands at Nelson Mandela Bay Stadium in Port Elizabeth on Friday.

The authorities dropped the charges against Hilton, after her co-accused, a former Playboy playmate of the month, Jennifer Rovero, "acknowledged to be in possession of cannabis, and pleaded guilty", said Brig Sally De Beer, a spokeswoman for South African police. Rovero, 31, from New York, was sentenced to a fine of 1,000 rand (€103) or 30 days' imprisonment, Brig De Beer said.

Police said Hilton and Rovero were taken into custody after officers could smell whiffs of cannabis coming from their direction, while they were outside the stadium.

Bodyguards then ushered the two inside the stadium where police apprehended them, the court heard.

A publicist for Hilton said the incident was a "misunderstanding".

"Paris Hilton was questioned today by police in South Africa on allegations of smoking marijuana," a publicist for Hilton, Dawn Miller, said in a statement.

"However, I can confirm that the incident was a complete misunderstanding and it was actually another person in the group who did it," the statement said. "The case has been dropped against Paris and no charges will be made."

When told the case had been dropped, Hilton said "thank you" and left the courtroom.

Hilton wrote on Twitter later: "Hey guys, there's a lot of crazy rumours going around. Just want you all to know the truth.

"Everything is completely fine. I was not charged or arrested, 'cause I didn't do anything."

She said that she was helping police with their investigation.

"Everyone was super nice and friendly to me," Hilton wrote. "I love South Africa! Such an amazing place, especially during The World Cup! Hope that clears everything up."

Hilton pleaded no contest in 2007 to alcohol-related reckless driving and was sentenced to 45 days in jail.

However, after spending about 23 days in jail, Hilton told US television host Larry King that the experience had caused her to re-evaluate the role partying played in her life.

She said that she wanted "to help raise money for kids and for breast cancer and multiple sclerosis".