A Long Island teen brought one of the world’s hottest chili peppers to school to spice up his lunch — but he landed in detention when his dopey pals asked for a bite and couldn’t handle the heat.

Nick Lien, 16, told The Post he gave bits of the eye-watering “ghost pepper” to his Centereach HS friends on Thursday with a warning that they’d soon have smoke coming out of their ears.

“They asked if they could try it. They’re teenagers, and they thought they could handle anything,” Lien said. “Maybe five to 10 seconds, later it affected some of them.”

Three of the boys had such a bad reaction that their faces turned the color of Tabasco sauce. They grabbed their stomachs and raced off to find any relief.

“One ran to go get milk. Two were standing trying to fume it out and then they went to the nurse. They aren’t mad at me but they were in the moment,” Lien admitted.

School officials weren’t so quick to forgive.

On Tuesday, he got two days of after-school detention for serving up the pepper — officially known as bhut jolokia — which clocks in at a staggering 1,041,427 Scoville heat units.

In comparison, a jalapeño pepper has 8,000 SHU and a habañ ero has 350,000.

Nick’s mom, Sharon Lien, 43, is furious over the punishment — saying ghost peppers are perfectly normal at her kitchen table.

“He didn’t do anything wrong,” she fumed. “The school is worried about him bringing a pepper when there’s heroin and pot in this district.”

Lien said that school officials compared her son’s actions to handing out LSD — even though she regularly cooks soups and pasta sauce with the pepper for “health benefits.”

Sharon Lien has threatened to take her food fight with the school to court, but officials are not backing down. “You can’t bring things to school that could hurt other students. There needs to be consequences when you put another student in danger,” said Middle County Superintendent Roberta Gerold.

The teen said he bought the vicious veggie — which recently popped up in fast-food chains such as Wendy’s — in packs of three for $12 online.

He said he merely planned to put bits of the pepper on his turkey- and-cheese sandwich.

Experts said the peppers aren’t deadly but can cause intense pain.

“If a schoolchild eats one, it could feel like the end of the world. It causes stomach cramping and sometimes panic,” said chili-pepper expert Scott Roberts. “It can be a pretty dirty trick to play on someone.”