A Connecticut man shot a masked intruder to death yesterday — only to find out the person he killed was his 15-year-old son.

Jeffrey Giuliano fired at his son Tyler at 1 a.m. in the tony town of New Fairfield as the teen was apparently trying to break into the home of a relative next door to his dad’s.

The elder Giuliano allegedly pulled the trigger as the boy — wearing a ski mask — came at him with what appeared to be a shiny object, sources said.

After the shooting, the elder Giuliano sat at the curbside and waited for cops, unaware of the slain intruder’s identity, a police source said.

“The shooter did not know who the deceased was until we informed him,” Lt. J. Paul Vance, a State Police spokesman, told The Post.

A source said the father was in “utter shock.”

The tragedy unfolded when Giuliano got a frantic call from his sister, Alexis Scocozza. She told him she thought someone was trying to burglarize her home, police said.

Giuliano — a beloved fifth-grade schoolteacher known as “Mr G.” — grabbed a handgun and went to investigate, police said.

That’s when he encountered the intruder, who had a shiny object in his hand and lunged toward him, cops said.

Giuliano fired repeatedly, hitting the intruder, who was pronounced dead at the scene on Meetinghouse Circle Road, cops said.

Cops then told Giuliano, 44, the terrible news.

“All in all, it’s a tragedy,” Vance told The Associated Press.

The dad hasn’t been charged, but the investigation is ongoing.

Giuliano adopted Tyler — who had wanted to join the Air Force — when he was his fifth-grade teacher and after Tyler’s grandmother was no longer able to take care of him.

“He just cared so much. Tyler was such a great boy he couldn’t just leave him,” one of Tyler’s pals said.

The friend, who knew Tyler since the third grade, said no one at New Fairfield HS could make sense of the tragedy or figure out why he might have been breaking into his aunt’s home.

“We didn’t understand why Tyler was out. It’s just weird,” the friend said. “He wasn’t a delinquent or anything. He was always happy and outgoing.

“This just makes no sense at all.”

Tyler played soccer and was one of a only few students in a Civil Air Patrol class at his school.

“He loved flying,” said his friend.

“In class, you get to fly a plane with an instructor at Danbury Airport. It’s a really hard course.”

Additional reporting by C.J. Sullivan