A police officer is facing the sack after he was caught performing a solo sex act in a first-class train carriage.

Terry Malka was caught by staff with his hand on his genitals, attempting to hide it with the cover on the back of his seat.

But he failed to keep the sex act private and it was caught on CCTV, and he was arrested at the next station.

Police officer Terry Malka (pictured) was reportedly caught by staff with his hand on his genitals, attempting to hide it with the cover on the back of his seat

A court was told a railway employee had seen the lewd act on a train between Three Bridges and Gatwick Airport, in West Sussex, at around 11pm.

Prosecutor Edward Hand told the court Malka was 'slouched in the chair, legs open, and a head cover from a seat in his hand'.

Malka 'used the headrest cover to cover up his penis' when a second witness arrived, the court heard.

Mr Hand said: Mr Hand said: 'Just after 2255 a railway employee looked into a train and saw this defendant masturbating inside a carriage.

'He was slouched in the chair with his legs open with a head cover from one of the seats in this hand.'

'He looked up and saw the staff and used the head rest cover to cover up his penis,' Mr Hand said.

The station staff alerted train staff and they approached him when he emerged from the toilet with his trousers round his waist.

The 33-year-old admitted outraging public decency, saying he had a sleep disorder and had been working long hours.

The 33-year-old officer was caught masturbating on a train between Three Bridges and Gatwick Airport in West Sussex (stock photo)

Heather Oliver, for PC Malka, said he is an exemplary officer, saying: 'He recognises this was a wholly unacceptable course of conduct.

'He's clearly not seeking an audience or a reaction. He's clearly in his own world.

'He is utterly humiliated, ashamed and embarrassed and he must take on the chin the loss of his good name.'

Recorder Benjamin Gumpert said the chance Malka would avoid the sack was 'close to zero'.

Lewes Crown Court heard the PC was described as an outstanding member of the force by his inspector.

He joined the Met after serving as special constable during the London 2012 Olympic Games.