Authorities said school resource officer Blaine Gaskill was alerted to the shooter on campus and "responded to the scene in less than a minute".
St. Mary's County Sheriff Timothy Cameron said Officer Gaskill fired a round at the shooter and the gunman simultaneously fired back.
He said Rollins was later pronounced dead.
16-year-old Great Mills High student Jaelynn Willey is fighting for her life in hospital and 14-year-old Desmond Barnes is in stable condition.