The attack is suspected to be an act of revenge for exposing the man

But Mr Barquero is now fighting for his life after being stabbed in the chest

He then posted footage of the incident online to name and shame him

A man who exposed a pervert filming up a woman's dress is now fighting for his life after being stabbed in the chest and stomach in a suspected act of revenge.

Gerardo Cruz Barquero, 22, whose video of the incident has been watched nearly 1.5million times, has been left in intensive care following the assault.

He was attacked and stabbed twice, once in the abdomen and once near his heart, in the San Sebastian district of the San Jose Province in Costa Rica.

Scroll down for video

Gerardo Cruz Barquero (pictured) captured on film the moment he saw a man attempting to film up a women's skirt on the streets of San Jose, Costa Rica

But after naming and shaming the man online, Mr Barquero was stabbed in the chest and stomach (pictured)

The unnamed man was caught using a camera phone to apparently record up a women's skirt (pictured left and right). It has since emerged he is a Ministry of Finance accounting department employee

The brutal attack comes just days after he named and shamed a Ministry of Finance accounting department employee he caught filming up a woman's dress in San Jose.

In the video, he is heard saying to the man: 'Sir, are you having a good time filming the young woman?'

The man responds: 'I would stop following me if you don't want problems.'

But now he is possibly paying the price for exposing the high-ranking official after police say Mr Barquero was not robbed, and his family say they believe the attack was an act of revenge.

His aunty, who did not wish to be named, said: 'He is in a critical condition. They performed open-heart surgery and he is now in intensive care. The doctors have not told us anything else.'

The Administration and Finance department confirmed that the man caught filming under the woman's dress is a government employee in the accountancy department at the Ministry of Finance.

The ministry said it was considering disciplinary action against him.

Mr Barquero (pictured left and right), who is a father to a young girl, was praised for his actions after witnessing the man filming up the woman's skirt

Police said Mr Barquero's stabbing (pictured) may have been an act of revenge for exposing the high ranking official

A relative said Mr Barquero had been stabbed in the chest and stomach and is in a critical condition in hospital

Mr Barquero, who has a young daughter, learned after posting the images that there might be a police investigation against him for breaching the person's privacy.

In outrage, he responded: 'I really don't understand this country and how a good person can become a villain in a matter of seconds.

'How is it possible that I'm invading the privacy of a man who's filming a young woman's private parts?'