* Wanchope fought with security guard
* Had been in charge since February (Adds Wanchope quotes, detail)
SAN JOSE, Aug 12 (Reuters) - Costa Rica coach Paulo Wanchope resigned on Wednesday after being involved in a brawl with a security guard at the end of an Olympic qualifying match against Panama.
Wanchope, who was observing the match on Tuesday in Panama City between the respective countries' under-23 teams, was shown in video footage to retaliate after being pushed by the man.
"After a cordial meeting between Paulo Cesar Wanchope and federation (officials), the trainer decided to step aside and leave the position of coach of the national team," the Costa Rican Football Federation (Fedefutbol) said.
Wanchope apologised to Costa Rica and Panama fans for his behaviour, saying he lost his head when he was denied access to the pitch after the match, a 0-0 draw.
"We are human beings and unfortunately I reacted in an unacceptable way for the position I held," Wanchope told a news conference.
"But let this not stain what I have done for all of you," added Wanchope, who played for his country for a decade until 2006.
"The (football) ambience is tough, it's tense, but until yesterday I managed to handle it. One can tolerate comments by reporters and on social media and stay calm but it's hard to hold back when someone puts their hands on you."
Footage showed that, at the end of the game, Wanchope opened a gate leading down to the pitch and was pushed from behind by the security guard.
Wanchope turned around and pushed him back. The man kicked the coach in the thigh and then threw some punches at him, while Wanchope tried to wrestle him onto some plastic seats.
Several other security guards then intervened to pull the men apart.
Former Derby County, West Ham United, Manchester City and Malaga player Wanchope was named as Costa Rica coach in February.
He was previously assistant to Jorge Luis Pinto when Costa Rica reached the quarter-finals at the World Cup. (Reporting by Enrique Pretel, additional reporting by Carlos Calvo in Mexico City, writing by Brian Homewood/Rex Gowar,; editing by Amlan Chakraborty and Ian Chadband)