The victim had been walking along Bootham with his girlfriend at 5.45am today when he was assaulted by a white man, about 6ft tall, of medium build and wearing dark clothing.
The couple fled to Gillygate, where they called the police.
Crime Scene Officers closed Gillygate and part of Bootham as they conducted an investigation.
Police enquiries have found that the victim first encountered the suspect at around 3am near Bar 1331 and VUDU lounge in York City Centre.
Police are appealing to anyone who witnessed the incident, the suspect or the couple making off in the direction of Bootham to contact the York Serious Crime Team via 101.
Crimestoppers can be contacted anonymously on 0800 555 111.