The incident happened this afternoon when the Presiding officer was not present in the court.
"The condition of the woman is was reported to be serious," Dy SP Anil Yadav said.
Prem Pal Singh, a resident of Nauserpur area of the district, had come to the court for hearing of dowry harassment and domestic violence case filed against him by his wife Laxmi Devi, a resident of Khair in Aligarh district.
Laxmi had filed the suit against her husband six months ago in the court of Judicial Magistrate.
"He suddenly took out the knife and attacked his wife and tried to flee," police said quoting an FIR filed by Gajraj Singh, woman's brother.
A case has been registered against Singh, under Section 324 and 307 of the Indian Penal Code, police said, adding the women was being operated upon.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.