Owen Palmer, 55, a police constable from Norwich, had been "harassing" Christine Johnson, 36, for 15 months before killing her last August, Norwich Crown Court was told.
Less than a year before the attack, Mr Palmer had been warned by Ms Johnson's solicitor that he could face legal action for "stalking" her.
Charles Wide QC, for the prosecution, said Mr Palmer had been unable to accept that his relationship with Ms Johnson, a care assistant, was over. He had waited outside her home in Norwich, armed with a knife and CS spray.
Neighbours and Ms Johnson's parents heard screams and found her dead in the garden. She had suffered "awful wounds" to her neck. Mr Palmer was seen leaving the scene smiling. He went to the police station where he worked and told a senior officer he had murdered his girlfriend.
Mr Wide said the issue was not whether Mr Palmer had killed Ms Johnson, but whether he had been suffering from a depressive illness, which meant his responsibility for her death was impaired. He denies murder and the trial continues.Reuse content