New York City police arrested a man in connection with the vicious beating and sexual assault of a woman in Queens Sunday.

Carloz Salazar Cruz, 28, has been charged with attempted murder, assault, aggravated sex abuse and criminal possesion of a weapon.

Officials say the victim -- identified as a 23-year-old woman -- was walking on 41st Road near Main Street in downtown Flushing around 9 p.m., when the suspect suddenly appeared and dragged her into an alley where he beat and raped her.

A passerby, who saw the incident happening, immediately called 911.

Officer arrived on time to nab the 28-year-old drunken suspect as he began walking away from the crime scene.

The victim was rushed to New York Hospital in Queens in critical condition after sustaining life-threatening head injuries.