Shots were fired at a college classroom with a bullet going through a window while students were being taught inside.
The bullet hit a wall at the Paget Road campus of the City of Wolverhampton College, West Midlands Police said.
No-one was hurt and students and staff were evacuated by security staff.
The force said two shots were heard during Monday afternoon at the site which is opposite St Judes Primary Academy.
Officers carried out a fingertip search of the area and examined CCTV footage and lessons were moved to other parts of the campus.
Ch Insp Hasson Shigdar said: “We are deeply concerned that a firearm has been discharged in broad daylight in the vicinity of the college and also a primary school.”
“We do not believe that anyone in the college was targeted as the view into the building is restricted, however we have increased our patrols to offer reassurance to students and residents in the area.”
Midlands Live: Breaking news and local stories
The college said the campus opened as normal on Tuesday.
Principal Malcolm Cowgill described the shooting as an “isolated incident” and said lessons elsewhere were not disrupted.