Read Wednesday’s updates as we learn more about the shooting.

A man with a pistol walked into a classroom at the University of North Carolina at Charlotte late Tuesday afternoon and opened fire, fatally shooting two people and injuring four others on the last day of classes, the authorities said.

The police disarmed the suspect and took him into custody at a building on campus, Chief Jeff Baker of the U.N.C.C. Police and Public Safety Department said. The Charlotte-Mecklenburg Police Department identified the suspect as Trystan Andrew Terrell, 22.

The police declined to elaborate on a possible motive for the shooting.

On Wednesday, the university identified the six victims, all of whom were students. It said the two who were killed were Ellis Parlier, 19, of Midland, N.C., and Riley Howell, 21, of Waynesville, N.C.

The four students who were injured were Sean DeHart, 20, and Drew Pescaro, 19, both of Apex, N.C.; Emily Houpt, 23, of Charlotte; and Rami Alramadhan, 20, of Saudi Arabia.