The four wore masks but were identified by the wi-fi network. (Howard County Police)

A group of students in Maryland, US, who covered their school in racist, homophobic and anti-Semitic graffiti the night before graduation have been identified.

According to local reports, the four teens wore makeshift masks during the vandalism spree in an attempt to hide their identities.

This is an act of violence that rips the fabric of our community.

However, their plan was thwarted when their mobile phone automatically connected to the school’s wi-fi network.

The four teens, later identified as Joshua Shaffer, Seth Taylor, Matthew Lipp, and Tyler Curtiss, wore t-shirts over their faces as they spray painted offensive language across Glenelg High School campus on May 23 last year.

The graffiti included homophobic and anti-Semitic slurs as well as a direct attack on school Principal David Burton, who is black.

According to The Washington Post, students at Glengelg must log in from their phones with unique IDs in order to connect to the internet. After the initial login the devices then continue to ‘automatically connect whenever they are on campus’.

The group were sentenced to probation, community service and consecutive weekends in jail ranging from nine to 18 weeks.

At a press conference following the sentencing Attorney Rich Gibson said: “This was something that was 50 separate acts of hate, you have anti-Semitic graffiti, you have racist graffiti, racist graffiti that targeted Principal Burton by name, you have homophobic references that were made.

“This is an act of violence that rips the fabric of our community.”