A Hicksville man who beat a Southampton musician with a crowbar was sentenced Wednesday to 8 years in prison, Suffolk County prosecutors said.

Jalaluddin Khojandi, 26, pleaded guilty to first-degree attempted assault, District Attorney Thomas Spota said.

advertisement | advertise on newsday

In addition to serving time at an upstate correctional facility, Khojandi will serve 5 years' post-release supervision; a permanent order of protection also was issued for the victim, Spota's office said in a news release.

Prosecutors said Khojandi attacked Michael Hargreaves, 40, on July 31, 2011, after Hargreaves performed at a tavern in Bayport. Khojandi was angry because a woman with whom he had a relationship had attended the performance, according to the news release.

Hargreaves had a skull fracture and head cuts, authorities said.