A prison nurse has avoided jail over her secret love affair with an inmate who was seven years her junior.
Berenice Ivey, 28, wanted to marry 21-year-old Reuben Smith and have his children during their affair at Aylesbury Young Offenders' Institute in 2017.
She was handed a 15-month prison sentence suspended for two years after admitting one count of misconduct in public office at Amersham Crown Court.
The 21-year-old prisoner won the heart of senior nurse Ivey after he forced a fellow inmate to send an apology letter to the nurse after he had harassed her.
Smith then added her on social media on an illegal phone he had acquired in prison and the pair began a seven-month relationship, writing love letters and text messages to each other.
Prosecutor Walton Hornsby told the judge: 'I have to say the tone of the letters is tender and loving.
Prison nurse Berenice Ivey has been spared jail after she admitted engaging in an intimate relationship with a 21-year-old inmate while working at Aylesbury Young Offenders Institute
'It was a serious relationship between them. They talk about getting married and having children.'
The crown court heard how Ivey 'manipulated' her position to see prisoner Reuben Smith for more than 30 minute sessions of routine medical examinations, eventually exposing their secret affair to other medical staff at the prison.
The affair was uncovered when the couple's love letters were discovered and Ivey was charged with misconduct in a public office.
Sentencing Ivey, Recorder Nicholas Rhodes QC said: 'While you maintain there was no intimate sexual relationship and that is accepted, it is clear from the letters you had written that your relationship was proceeding that way and you had a strong sexual interest in each other.'
Having studied at Kings College for three years to obtain a nursing degree, the court heard how 'humiliated' Ivey had thrown her career away after a moment of madness spiralled.
Defence counsel Mohammed Saqib told the court in Amersham, Bucks., how the young prisoner had garnered the affections of the senior staff nurse who is now engaged and set to get married next May after reuniting with a former partner.
The court heard Ivey and inmate Reuben Smith discussed getting married and having children
'The defendant was subject to harassment but that was followed up by an apology letter which was prompted because Mr Smith had a quiet word to suggest the inmate should apologise for his behaviour.
'That took her by surprise and that laid the foundations before Mr Smith contacted her through Facebook.
'She would encourage him to act properly and behave well as he was often in the solitary confinement unit of the prison. He seemed to listen to her advice which was reassuring.
'She was going through a hard time, her self-esteem was at the lowest in her career, she let her guard down and things spiralled out of control,' Mr Saqib added.
In an 'exceptional' twist of events, the judge handed the former nurse a suspended sentence after he heard how she was three years into a six-year history degree at the Milton Keynes Open University.
Mr Recorder Rhodes QC was also impressed that during the three years since she the case first came to court, Ivey had completely re-trained and was working for an insurance company.
Berenice Ivey worked as a senior staff nurse at Aylesbury Young Offenders' Institute (pictured)
He said: 'There are clear rules about fraternising with inmates and all forms of relationships are off limits.
'You breached that trust by striking up a relationship with a prisoner seven years younger than you.
'You opened yourself up to blackmail and compromised the safety and security of all of those in the prison.
'However, this case has taken four years to come to court, imposing significant anxiety on you.
'You are now studying for a history degree. You have also obtained employment with an insurance company and you are in a stable relationship.'
Ivey, of Weedon Road, Aylesbury, Bucks., was sentenced to 15 months in jail, suspended for two years and will have to complete 150 hours of unpaid work.
Mr Recorder Rhodes QC added: 'It may be said that the sentence is too lenient but this is an exceptional case. You have come as close as anyone can to going straight to prison.'