The 16-year-old girl stabbed to death in Long Branch in September was killed by her 20-year-old ex-boyfriend after she broke up with him and he repeatedly texted her seeking to meet, authorities said.

The motive in the killing and the relationship between Bryan Cordero-Castro and Madison Wells was revealed by the Monmouth County Prosecutor’s Office this week as Cordero-Castro was indicted on murder, stalking and weapons offenses. Authorities had previously said only Cordero-Castro and Wells knew each other, but didn’t specify the nature of their relationship.

Though they began dating in November 2017, prosecutors didn’t say when Wells ended the relationship. She was stabbed to death on Sept. 8.

Cordero-Castro texted and called Wells, a junior at Long Branch High School, numerous times in the nine-hour period before she agreed to meet him to talk outside a home on Van Buren Place, officials said this week.

Cordero-Castro stabbed the teen outside the home sometime around 10:40 p.m., less than 45 minutes before she was pronounced dead at Monmouth Medical Center. She apparently stumbled into the home’s living room where emergency workers and police found Wells with stab wounds to her chest.

Bryan Cordero-Castro, 20, is charged with killing Madison Wells, 16, in Long Branch.

Police arrested Cordero-Castro about two hours later at a cousins' home on Morris Avenue in Long Branch, the prosecutor’s office said.

Cordero has been held without bail since his arrest. He is scheduled to be arraigned Jan. 7 and faces a minimum sentence of 30 years in state prison if convicted of murder.

Cordero-Castro, a Guatemalan citizen, is in the United States illegally, the prosecutor’s office said at the time of his arrest.