A Westbury man who gunned down a fellow immigrant from El Salvador last year as the victim shoveled snow at his Uniondale home was sentenced to 21 years to life in prison Thursday for a murder that authorities said stemmed from a dispute over a woman.

The sentencing of Joel Arquimides Ayala Deras, 35, of Fourth Avenue, before acting state Supreme Court Justice Jerald Carter, follows Deras’ guilty plea to second-degree murder in November in the Jan. 26, 2016 killing of German Ismael Saravia Melendez, 37, a construction worker and father.

Deras had staked out Melendez’s home for months waiting for an opportunity to kill him, authorities said. The defendant struck at about 9:44 p.m. when he spotted Melendez shoveling snow to clear a spot for his car near Macon Place and Irving Place.

Police said Deras was carrying several guns to commit the crime, and that he pointed a shotgun out of his tan Toyota Corolla and struck Melendez in the back and arm. He drove away, police said, but returned shortly to finish off his victim, this time putting two shots in the back of Melendez’s head.

The crime was all the more shocking to relatives of the victim since the two men had grown up in the same village, Caserio Las Victorias, in their native El Salvador. Melendez had been in the United States since 2002.

“This calculating defendant stalked his victim for several months, waiting for the right opportunity to take his life,” Nassau District Attorney Madeline Singas said in a statement announcing the sentence. “Mr. Melendez was the victim of senseless gun violence and was only 37 years old at the time of his death. I thank our prosecutors and our partners in the police department for bringing the violent defendant to justice.”

advertisement | advertise on newsday

Deras was represented by the Legal Aid Society, which does not comment on cases.

Police arrested Deras after spotting a vehicle matching the description of the one that a 911 caller reported was seen fleeing the scene and found three guns — a .44 caliber handgun, a shotgun and a .380 caliber handgun, authorities said.