A man sent a text message to his ex-partner to say he was “getting out of here” with their two-year-old son before he allegedly murdered the infant, a court has been told.

Lukasz Czapla, 41, is on trial at the High Court in Edinburgh accused of murdering Julius Czapla at a property in Muirhouse in the city on November 20 or 21 2020.

At a hearing on Friday, a 15-strong jury was shown text messages between Czapla and his former partner Patrycja Szczesniak on the eve of the discovery of their son’s body.

The messages, translated from Polish, revealed Ms Szczesniak was seeing another man.

During the exchange at about 9.30pm, Czapla asked if the new partner was “someone more permanent”, to which Ms Szczesniak replied: “I won’t give you too much details ’cause that tends to end up badly…”

A follow-up message sent from Czapla at about 3am on November 21 read: “I won’t be raising my son from a distance and cry every single time we say goodbye.

“It seems you are raising him with another guy, soon enough I’ll have to pay alimony, now you see why I didn’t want to have a kid with you.

“I know I didn’t want to with you and making a kid was asking for a tragedy.

“And I don’t have a way out of this situation.”

The message went on: “I am getting out of here. There’s no life for me here anymore.

“I am taking Julek (Julius) with me since I am not leaving him with no father like I was left.”

The end of Czapla’s seven-year relationship with Ms Szczesniak in 2020 made him depressed, the court was told previously.

Jurors were also shown text messages between Czapla and a person called “Lipson”.

The two discussed medication, with some of Czapla’s messages indicating he had tried multiple anti-depressants which had not worked.

Some of his texts shown to the jury read: “F*** drugs.

“They won’t change the fact that my life is f****ed up.”

The court then heard a transcript of a phone call between Czapla and a person called Wojciech on December 3 2020.

During it, the accused spoke about what he remembers from the night his son died, saying: “I got stuck with some drugs and I simply had some kind of sick trip.

“I must have lost it. I don’t remember it all but I remember drinking and eating drugs.”

He went on to talk about his depression, saying: “I couldn’t take it anymore. I could hardly go to sleep.”

Czapla said he was “agonising over what happened”, telling Wojciech: “You know how close me and Julek were.”

He added: “They say that I might spend the rest of my life behind bars but I hope that doesn’t happen because it’s never happened to me before.”

Czapla could be heard saying he had “missed some kind of support due to the coronavirus” and had tried to arrange counselling through his GP and a change of accommodation.

The court then heard a transcript of a voicemail Czapla left for another contact in his phone the same day.

Speaking about the night his son was allegedly murdered, he said: “I don’t remember. I was in a terrible state.”

He said Ms Szczesniak had “pissed me off”, adding: “I got so furious and I started to drink wine and eat drugs to calm myself down.

“I wanted to simply kill myself.”

He then requested his contact speak to his lawyer, adding: “You’ve known me for many years and I am not some murderer.

“You don’t think it was my normal behaviour.”

He added: “I regret what happened. You know how important Julek was to me.”

Czapla could be seen in the dock wiping away tears from under his face mask before putting his head in his hands.

Earlier, the jury saw Czapla repeatedly saying he could not remember the events surrounding his son’s death in a video recording of a 70-minute interview between the accused, Detective Sergeant Christopher Edmund and Detective Constable Roderick Scott hours after Julius was found dead.

Mr Scott, now retired, was heard telling Czapla: “Your son is dead. Your only son Julius is dead.

“Do you remember seeing him dead?

“How did Julius, a two-year-old boy, die in your house, in your bed?”

Czapla, slumped in a chair with his hands loosely crossed on his lap, replied: “I don’t know.”

The 41-year-old has admitted killing Julius and offered to plead guilty to the lesser charge of culpable homicide.

Iain McSporran QC, defending, called for a “special defence” which states the accused was suffering from diminished responsibility at the time of his son’s death.

Both were rejected by the Crown.

He faces nine other charges, including drink-driving, drug possession, and having an air weapon.

The trial, before Lord Beckett, continues.