Five people, including four students, were shot on the Morgan State University campus in Baltimore on Tuesday night during annual homecoming events, prompting an hourslong shelter-in-place order and the cancellation of classes on Wednesday. The police have yet to locate a gunman.

One woman and four men, ages 18 to 22, were being treated for gunshot wounds that weren’t life-threatening, Richard Worley, the city’s police commissioner, said at a news conference early Wednesday. The university’s president, David Kwabena Wilson, said that he had canceled classes Wednesday.

The shooting happened shortly after an annual homecoming ritual to crown Mister and Miss Morgan State in the lead-up to the football game on Saturday. At historically Black colleges and universities, homecoming is an important tradition that brings together generations of students and alumni.

Police officers who were on patrol heard gunshots at about 9:25 p.m. as students made their way from the packed auditorium in Murphy Fine Arts Center to a coronation ball at the University Student Center. The university asked people to stay clear of the area surrounding the arts center and Thurgood Marshall Hall, a nearby dormitory building where the police warned there was an active shooter.

Minutes later, the officers found the victims and noticed that windows had been shattered, leading them to believe that there was an active shooter, Mr. Worley said. The Baltimore Police Department soon issued a shelter-in-place order, which was lifted early Wednesday.

The police have not located a suspect or made any arrests, Mr. Worley said. But he said that the decision to lift the shelter-in-place order came after it was determined that there was no longer an active shooter situation.

“We didn’t open the campus up until our SWAT team had cleared the building where the suspect may have ran, or where we thought the shot came from,” he said, adding that the police believed the shooting had taken place outdoors.

Tuesday night marked at least the third consecutive year that a shooting has disrupted homecoming week at Morgan State. A man was shot last October at an “unsanctioned” homecoming after party. Two years ago, a student was shot at the conclusion of an otherwise peaceful homecoming week.

Federal agencies, including the Federal Bureau of Investigation and the Bureau of Alcohol, Tobacco, Firearms and Explosives, said they were assisting with the response to the shooting. Gov. Wes Moore of Maryland said that his office was aware of the situation.

“The repetition of these horrific events is about one thing: easy access to guns,” Bill Ferguson, a Democratic state legislator who represents Baltimore, said on social media. “I cannot even fathom the feelings of parents who are fearing the safety of their children at Morgan tonight.”

Morgan State University is one of Maryland’s oldest historically Black colleges, with about 9,000 enrolled students.

The situation at Morgan State on Tuesday night was only the latest example of an armed person threatening a college campus. In August, a graduate student at the University of North Carolina at Chapel Hill was charged with killing a faculty member.

Later that month, a white gunman drove onto the Jacksonville, Fla., campus of Edward Waters University, a historically Black college, where he put on a bulletproof vest and drove away minutes later, before killing three Black people in a nearby Dollar General store.

In February, a gunman killed three students and injured five others on the campus of Michigan State University.