The Rev Matt Martinson is one of 14 men and women who will be appointed to the priesthood by the Archbishop of York, Dr John Sentamu, at York Minster.
Mr Martinson – curate at St Nicholas Church, Beverley – says he made a pact with God when he was half expecting to die.
He said: "I said to him: 'If you get me caught alive, I will bow my knee to you', because at that time I was getting involved in armed robbery, and with the firearms issues the violence was growing, and it was a very dangerous world.
"I'd come to the point in my life when I'd had enough, I couldn't take any more.
"I tried to commit suicide, but it didn't work."
The 35-year-old had a traumatic childhood – his father was an alcoholic and drug addict – and he joined the Army to get away. He came out in a "real mess", living rough on a boat in York, and became involved in armed robbery, fighting and dealing drugs. He was arrested for armed robbery in 1995 and was sentenced to 11 years.
Prison was tough, but a prison chaplain at the Wolds, in East Yorkshire, David Casswell, took him under his wing and he eventually served just under four years before being paroled.
After coming out of prison, Mr Martinson went to live with another chaplain and continued his spiritual journey, ending up at Bridlington where he met his future wife Haley in church.
They have been married 10 years now and have a nine-year-old son, Seth.
Mr Martinson said that on Sunday he will reflect on the past. "I feel really excited about my ordination, but it's taken a long way to get here," he said. "When I come to York on May 30, I'll cross over Lendal Bridge on my way from the train station – I used to live in a boat under that bridge.
"To look back where I've come from, to where I've come, is to see God's grace at work."
The Rev David Mann, the diocesan adviser on vocations, said: "Matt's story shows how God can change a person's life.
"He's been helped by some great priests in his journey, and I'm sure he will be just as inspirational in his ministry."