Nearby shopkeepers rushed to the spot after hearing her cries and rushed her to the district LNJP Narain hospital in a serious condition, from where she was referred to PGIMER at Chandigarh, police said.
The accused was nabbed immediately by the shopkeepers and arrested, SP Simmardeep Singh said.
According to police, Vishal alias Rinku, a resident of Bishangarh near here, attacked the girl on her head with the sword when she was coming back from the roof of the complex along with a fellow woman employee.
Police said the duo had been seeing each other for the last one year. The accused reportedly got annoyed with the girl a few days back over some issue, they said.