A hard-working immigrant IT worker who had married his partner in July was shot dead near his Queens home early Tuesday after a 12-hour shift at a Midtown analytics firm, police said.

Mohamed Hamwi, 48, had taken the LIRR to the Jamaica station and was walking to his home at 173-47 105th Ave. with his ear buds in about 12:15 a.m. when he was shot twice at 105th and 173rd Street, cops said.

The victim, who fled his native Syria and became a Canadian citizen before moving to the US, was rushed to Queens General Hospital, but was pronounced dead on arrival, cops said.

Hamwi’s mother-in-law, Zona Tomlinson, 59, said she and her son — who married Hamwi in July — went to the hospital to identify his body, though her son was too distraught to look at his husband.

“He looked like he was sleeping. The left side of his nose was bloody. His eyes were closed but blood was coming out of the right eye,” she said, declining to identify her son.

“It’s a feeling nobody wants to feel. Like your stomach had just fallen out. My son was screaming. I haven’t cried yet.”

Cops believe it was an attempted robbery that apparently went bad. His mother-in-law said the victim’s wallet and iPhone were still on him when he was found.

Tomlinson said Hamwi worked from noon to near midnight at Trepp, a business-to-business real estate analytical company at 477 Madison Ave. between 51st and 52 streets.

She said he didn’t have any enemies that she knew of, and described him as a computer “geek” who worked long hours.

“He was the type of guy who goes to the corner store and comes right back home. He goes to work, he is on the computer. He comes home, he is on the computer,” she said.

“He was a very nice person, very giving person — not just to his family but to me. I was like his mother here,” said Tomlinson, who is of Jamaican descent. “He liked my curry beef and jerk chicken, so I’d cook for him.”

A certified nurse’s assistant, she recently completed a course in phlebotomy, and Hamwi was planning a trip to Jamaica for her to celebrate.

“That was his gift to me,” she said, adding that she last heard from him on Monday when he texted her about her airline ticket.

The victim’s mother still lives in Syria and he also has relatives in Turkey, she added.

Neighbor Caroll Forbes, 67, a retired teacher, said she heard two shots and then the police responding.

“I’m upset that he was able to be killed out here like that and so many people have guns and it’s okay to shoot people. It actually makes me want to move,” Forbes said.

Trepp says on its website it is the leading provider of commercial mortgage-backed securities and commercial mortgage information, analytics and technology.