Four Maryland teenagers who snuck onto their high school campus the night before graduation last year and covered it in racist, homophobic and anti-Semitic graffiti were caught because their phones automatically connected to the wifi.

Seth Taylor, Tyler Curtiss, Joshua Shaffer and Matthew Lipp were convicted of vandalism and hate crime charges in March, their sentences ranging from eight to 18 weekends in jail.

The teens were wearing their caps and gowns when they were arrested on the morning of May 24, 2018, after the vandalism was discovered just as families arrived for an awards ceremony at Glenelg High School in Glenelg, Maryland.

The boys had covered their faces when they carried out the crime. They didn't realize that their individual student IDs would be recorded when their cellphones connected to the Wi-Fi at 11.35pm on May 23.

Taylor would later say that the teens meant to spray paint 'Class of 2018', but the senior prank flew out of control.

Instead, the four men tagged the campus with crude penis drawings, swastikas, 'KKK', 'Jews', 'f*gs', 'n*gs' and the word 'f*ck' over and over.

Principal David Burton, who is black, estimates that there were more than 100 markings in total, left on sidewalks, walls, trash cans and lunch tables.

For the principal, the most jarring marker was one that said: 'BURTON IS A N***ER.'

Scroll down for video

Four Maryland teenagers who snuck onto their high school campus the night before graduation last year and covered it in racist, homophobic and anti-Semitic graffiti

Four Maryland teenagers who snuck onto their high school campus the night before graduation last year and covered it in racist, homophobic and anti-Semitic graffiti were caught because their phones automatically connected to the wifi. Pictured in their mugshots are (clockwise from top left): Joshua Shaffer, Tyler Curtiss, Matthew Lipp and Seth Taylor

Burton, 50, recounted the horror discovery to the Washington Post in a feature published Tuesday.

He was on his way to work on the morning of May 24 when the assistant principal called him and began ranting about graffiti on campus, saying: 'It's everywhere.'

What was supposed to be a proud day for the principal and Glenelg turned into a nightmare as he surveyed the sea of slurs across the school.

Glenelg High School is the only majority-white school in Howard County, a diverse Maryland suburb between Washington, DC, and Baltimore that frequently lands on national 'Best Places to Live' lists.

Some 100 slurs were spray-painted at Glenelg High School in Maryland on May 23, 2018

Surveillance video captured the four vandals at the school at around 11.35pm. They had covered their faces with T-shirts but didn't know their student ID's were recorded when their phone automatically connected to the campus wifi

Burton had often referred to the area as 'Pleasantville', due to its impressive reputation as an inclusive community with great schools.

His perception changed drastically after the indisputable hate crime.

Burton retreated into his office to compose himself as school staff worked to cover as much of the graffiti as they could before students and parents arrived on campus.

Guests were directed to alternate entrances to avoid the worst of the vandalism - but photos of it spread quickly throughout the community.

Burton rewrote the speech he was planning to give at the ceremony before touching base with police about what they'd found on security footage.

He took the stage at looked out at the 260 seniors clad in red caps and gowns, certain that the vandals were among them.

'We are not going to let this ruin your celebration,' Burton told the students, 20 of whom were black.

Principal David Burton (pictured) was one of the first people to come across the graffiti on the morning of May 24, 2018, just as families were arriving for a graduation ceremony

A large swastika is seen spray-painted in the middle of the parking lot at Glenelg High School. Cameras around the school captured each vandal's contribution to the graffiti

Seth Taylor told his version to the Washington Post as well, remembering how he tried to hide under his graduation cap as Burton gave his speech.

He attempted to quell his anxiety by convincing himself that there was no way he and his friends could be caught since they had covered their faces.

The plan to vandalize the school had come together while Taylor was at his friend Matt Lipp's house, along with Josh Shaffer and Tyler Curtiss.

Taylor said he was the only one in the group who wasn't downing Bud Light beers when the senior prank discussion came up.

Suggestions including supergluing locks and releasing three pigs into the school were floated before someone proposed the much more simple plan to spray paint 'Class of 2018'.

Minutes later the boys armed themselves with spray paint and drove to a church by the school, where they tied T-shirts over their faces before sprinting to campus.

They emblazoned the three words they'd planned on the sidewalk - but Shaffer wasn't done.

Taylor said he watched as his friend began writing: 'BURTON IS A N***ER.'

'I wish I said something like: "This is stupid, guys. It's not worth it. We could actually get in trouble for this,'" Taylor told the Post more than a year later.

'I don't know. Everyone was doing it. We didn't realize the consequences,' he said of his failure to speak up.

'It was just spray paint. It just happened. It is all a blur.'

Seth Taylor was the first of the four boys to be questioned by police hours after the vandalism was discovered. He was the only one who immediately admitted to being involved

Surveillance video submitted to the court during their trial captured each of the boys' contributions to the graffiti.

Shaffer smeared the principal, Lipp targeted Jewish, gay and black people, Curtiss painted two swastikas and Seth drew swastikas, 'f*gs' and 'KKK'.

At the end of a seven-minute spree, the teens swore that they would never confess.

Hours later, Taylor went back on his promise.

He was sitting in the awards ceremony when the school's athletic director approached him and said: 'Seth, you need to come with me.'

Two police officers waiting outside the auditorium escorted Taylor to school resource officer Steve Willingham's office.

Security footage from the night before was up on the TV screen, paused on Taylor's figure.

Willingham asked him: 'Do you know why you're in here?'

'Yes,' he replied.

'What happened?'

'Things got out of hand,' Taylor said as he unsuccessfully fought back tears. 'I was under the impression we were going to do a prank, and it got bad.'

Taylor was the only one out of the four boys who immediately admitted to the vandalism.

He would later learn that Willingham questioned him first on purpose, because he suspected Taylor would be the most likely to come clean.

In the end the other three's denials didn't matter, as the school wifi system recorded them online at the time of the crime.

All four suspects were arrested and charged with vandalism, destruction of property and a hate crime - punishable by up to six years in prison.

Two of them tried to have the hate crime charges dismissed under the First Amendment, but the free speech argument didn't hold up.

Curtiss is seen participating in a service at Linden-Linthicum United Methodist Church in Clarksville, Maryland, on May 19, 2019. He was sentenced to eight weekends behind bars

Taylor is seen driving past Glenelg High School on the anniversary of his arrest

Shaffer was the first to be sentenced on March 8, 2019. He received three years of probation, 250 hours of community service and 18 consecutive weekends in Howard County Jail.

Lipp was sentenced to 16 weekends, followed by Taylor with nine and Curtiss with eight.

They will all be eligible to have the hate crime expunged from their records after they complete probation.

Lipp filed an appeal, still arguing that his First Amendment rights were violated.

In the wake of the scandal, Burton created a task force of diverse students to improve the school's climate and make it a safe place for marginalized groups.

Every freshman is now required to complete an empathy workshop.

When Burton arrived at the school for graduation this year, there was no graffiti waiting for him.

Instead, he watched as a tractor entered the parking lot carrying an old couch with a blue flag that said: 'TRUMP - MAKE AMERICA GREAT AGAIN.'

In the wake of the scandal, Burton created a task force of diverse students to improve the school's climate. He is seen at a meeting of the 'Climate Committee' on May 10