PROVIDENCE, R.I. — A federal judge has allowed a Brown University student accused of sexual assault and suspended for two years to resume classes while awaiting a decision on a lawsuit he brought against the Ivy League university.

Brown found that the student, identified in court papers as John Doe, was responsible for sexually assaulting a female student and suspended him in April. Doe maintains that the encounter was consensual, and he sued the university.

U.S. District Judge William Smith held a bench trial over the summer. Smith is writing his decision and said in an order issued last week that Doe is likely to succeed, at least in part, in his breach of contract claim and “will suffer irreparable harm if his suspension remains in place and he is unable to start the fall semester.”

Smith had issued a temporary restraining order in April that allowed Doe to finish out the spring semester.

The judge also said in last week’s order that Doe may not contact his accuser.

“Given this safeguard, the court finds that Doe’s interest in resuming classes outweighs Brown’s interest in keeping him off campus while the outcome of the case is finalized,” he wrote.

Still, Smith cautioned that his order is not a final decision on the merits of the lawsuit. That decision will be issued “in the near future,” he said.

Classes begin Sept. 7.

A Brown spokesman said the decision means his status is unchanged and he can choose to remain enrolled.

“We await the judge’s further decision,” Brown spokesman Brian Clark said.

Lawyers for the woman, identified under the pseudonym Ann Roe, and Doe’s own lawyers did not return messages seeking comment.

The two have also sued each other in federal court. Doe sued his accuser for defamation, while Roe countersued for sexual battery and intentional infliction of emotional distress. Those lawsuits are pending.

The encounter happened in November 2014, when the two met to watch a movie together in a campus building. In October 2015, the woman filed a complaint saying that he had forcibly penetrated her with his fingers and that she gave him oral sex to “avoid being raped.”

Doe’s lawyer argued during the trial that Brown used a different definition of “consent” than the one that was the policy at the time of the encounter. Brown’s lawyer has said the procedure was fair and the hearing panel had a rational basis for its finding.

Doe’s lawsuit asks to be reinstated as a student and to stop the university from handling complaints using the current process.

The lawsuit is one of several faced by Brown in recent years by men accused of sexual assault who say they were unfairly treated by the university. Several other universities around the country are facing similar lawsuits amid a push by federal authorities aimed at getting schools to better address sexual assaults on campus under Title IX, the federal anti-discrimination law.