The alleged killer of right-wing activist Charlie Kirk appeared to take responsibility for the shooting on the messaging platform Discord, a company spokesperson has confirmed.

According to the spokesperson, Tyler Robinson, 22, messaged friends in a chat on Discord hours before he was arrested last week in connection with Kirk's shooting at an event at Utah Valley University.

It was me at UVU yesterday. im sorry for all of this, reads a message from an account that allegedly belongs to Robinson, according to the spokesperson and a law enforcement source.

Robinson, who has not yet been formally charged, is due to appear in court on Tuesday.

Arrested on suspicion of aggravated murder, felony discharge of a firearm and obstruction of justice, he could face the death penalty.

The Discord messages which are said to be from Robinson were first reported by the Washington Post and are thought to have been written and posted towards the end of a manhunt for Kirk's killer that lasted more than a day.

Charlie Kirk, 31, who was a controversial figure in US politics and a trusted ally of President Donald Trump, was speaking at Utah Valley University on Wednesday at an open-air event held by Turning Point USA - the organisation he co-founded - when he was hit in the neck by a single bullet.

The killing of the popular social media personality sparked outrage, with Democrats and Republicans accusing each other of spreading hateful rhetoric, and a hunt for his killer. Utah's Governor Spencer Cox said Robinson had been arrested after confessing about Kirk's killing to his father and being persuaded to hand himself in.

Law enforcement sources have told CBS News that Robinson and his friends bantered about the shooting before his arrest in a group chat on Discord involving more than 20 people.

The spokesperson for the platform said that an internal investigation by the company had found no evidence that the suspect planned this incident or promoted violence on Discord.

Robinson is said to have been questioned in the group about whether he was the gunman, which he did not appear to reject, and there were also jokes from one group member about him needing to avoid McDonald's, which is where Luigi Mangione, the alleged killer of UnitedHealthcare CEO Brian Thompson, was arrested.

Messages from the account thought to belong to Robinson also indicate that he was planning to hand himself in.

im surrendering through a sheriff friend in a few moments, thanks for all the good times and laughs, you've all been so amazing, thank you all for everything, reads one.

Cox has said that Robinson was not co-operating with authorities but his roommate was among those who were.

FBI director Kash Patel, who has been criticised over his handling of the case, told Fox News in an interview on Monday that a text message exchange had been found on Robinson's phone in which he specifically stated that he had the opportunity to take out Charlie Kirk, and he was going to do that.

Investigators have been trying to establish a motive for the killing. Cox has previously said that Robinson, a Utah native, was deeply indoctrinated with leftist ideology. Public records reviewed by the BBC suggest Robinson had in the past registered as an unaffiliated, or nonpartisan, voter in Utah. His parents are registered Republicans, according to state records.

However, according to Cox, a family member told investigators that Robinson had become more political in recent years and had specifically mentioned Kirk's impending visit to Utah Valley University during a dinner.

One of Donald Trump's top officials, deputy chief of staff Stephen Miller, has alleged that there was an organised campaign behind the assassination, but no evidence has been presented so far that suggests Robinson was working as part of a group.

Kirk, a devout Christian, was a strong supporter of gun rights, vehemently opposed abortion, was critical of transgender and gay rights, and promoted false claims about Covid-19. His supporters said he was relatable, understood their concerns and was able to hold respectful debates with those he disagreed with. But his views drew fierce liberal criticism, with his detractors calling his comments deeply offensive to some minority groups.

Turning Point USA, which Kirk co-founded, aimed to spread conservative ideals at liberal-leaning US colleges, and played a key role in getting people to vote for Trump and other Republican candidates in the election last year.