MIAMI-Nikolas Cruz reached for his cellphone before his rifle.

Shortly before killing 17 people at Marjory Stoneman Douglas High School on Feb. 14, Cruz recorded three cellphone videos discussing his plan to murder students and staff.

"With the power of my AR-15 you will all know who I am," Cruz said on one video.

Prosecutors released the videos Wednesday afternoon as they prepare for a possible death penalty trial. The videos may shed light on what motivated Cruz to commit Florida's worst school shooting, which has launched a powerful nationwide movement for gun control.

Cruz, a former Stoneman Douglas student who seems to have meticulously planned his attack, expressed anger at his old classmates, saying they thought he was an "idiot and a dumb ass" when in fact it was they who had been "brainwashed by these f---ing political government programs." And he declared his love for a girl he identified only by her first name, saying he hoped to see her "in the afterlife."

The videos will almost certainly bolster the prosecution's efforts to convict Cruz of first-degree murder, a capital offense: Under Florida law, first-degree murder charges must be premeditated.

On another video, wearing a green T-shirt and dark baseball cap, the former student at the Parkland high school looks into the camera.

"Hello. My name is Nik and I'm going to be the next school shooter of 2018," Cruz, 19, says calmly. "My goal is at least 20 people with an AR-15. ... Location is Stoneman Douglas in Parkland, Florida."

"It's going to be a big event," he added. "And when you see me on the news, you'll know who I am."

Then Cruz laughed.

"You're all going to die," he continues, making gunshot sounds. "Can't wait."

Cruz's massacre killed 14 students and three educators and left another 17 people wounded. He faces 17 counts of first-degree murder and 17 counts of attempted first-degree murder. His public defender has said Cruz would plead guilty in hopes of avoiding the death penalty.

The recordings were released by the Broward State Attorney's Office Wednesday in response to a defense request for discovery, which is when the state turns over all the potential evidence against a defendant. In Florida, many elements of discovery are considered a public record.

Authorities did not say when exactly the videos were made, although Cruz suggests in one that he would carry out the attack later the same day. His cellphone was confiscated as evidence after the attack.

Gordon Weekes, Cruz's defense lawyer from the Broward Public Defender's Office, declined to comment Wednesday.

Cruz's violence and bizarre behavior worried neighbors and classmates for years before the Parkland massacre. He was legally able to purchase the AR-15 rifle he used in the assault. Some parents of the dead have argued that the Broward Sheriff's Office and Broward County Public Schools could have done more to stop the shooting, which took place in Stoneman Douglas' freshman building.

The videos show Cruz laid out his attack in advance. "Here's the plan. I'm going to take an Uber in the afternoon before 2:40 p.m.," he said in one video clip, the camera facing the floor, Cruz apparently sitting on a bench.

"From there, I'll go into the school campus, walk up the stairs, load my bags and get my AR and shooting people at the main courtyard and people will die."

Cruz opened fire at 2:21 p.m. on Valentine's Day after arriving on campus in an Uber.

Police say Cruz confessed to the crime soon after being arrested about an hour after the attack. He was able to elude BSO deputies and police officers who responded to the scene, ditching his weapon inside a stairwell before slipping off campus and walking to a nearby Walmart and McDonald's.

In another clip, Cruz appears to be reading prewritten words.

"Today is the day, the day it all begins. The day of my massacre shall begin," Cruz said. "All the kids in the school will run in fear and hide."

In the clip, Cruz casts himself as the victim, saying he lives in "seclusion and solitude" and that his life was "nothing and meaningless."

He also seems to profess his devotion to a girl _ and suggests he didn't plan on surviving.

"My love for you ... will never go away," Cruz says. "I hope to see you in the afterlife."