A letter from Stanley Teitel announcing his resignation as Stuyvesant High School's principal was posted on the school's website.

Just weeks after a cheating scandal erupted at Stuyvesant High School, the schools longtime principal has resigned.

Stanley Teitel delivered his letter of resignation to Chancellor Dennis Walcott at 3:30 p.m. today, according to the Department of Education.

Teitel and Stuyvesant were thrust under scrutiny in June after news broke that dozens of students at the ultra-competitive school had received answers in advance to a Spanish exam via one student’s cell phone.

Teitel sent a letter to parents June 20 alerting them to the cheating and informing them that students suspected of cheating would lose some privileges, such as the right to leave campus for lunch. But the city did not find out about the cheating allegations for nearly a week after that letter went home, and the penalties the school levied did not match those outlined in the city’s discipline code.

An initial phase of the cheating investigation concluded in early July, with the city requiring 69 students to retake the end-of-year Spanish exam they took in June.

When he announced the penalties, Walcott said the next phase would be to examine whether Teitel and his staff followed the appropriate protocol after learning about the cheating.

“We have to look at the process,” Walcott said during a radio appearance. “Once the allegation was made, what happened after that?”

The investigation is ongoing, Department of Education officials said today.

Teitel had led the ultra-competitive school for 13 years. He had worked there for nearly three decades and worked in the city schools for 41 years. In a letter to students, faculty, parents, and alumni posted today to the school’s website, Tetiel said his retirement would begin Sept. 1.

“It is time to devote my energy to my family and personal endeavors,” he wrote. He did not mention the cheating investigation.

Department officials said a replacement for Teitel would be named next week.