A student who shot and critically wounded two fellow students at a Maryland high school on Tuesday morning died after exchanging gunfire with a campus security officer, the county sheriff said.The school day had barely begun when the student, who has not been identified, shot a male student and a female student at Great Mills High School in St. Mary's County before the campus security officer intervened, county Sheriff Timothy Cameron told a news conference."Our school resource officer who was stationed inside the school was alerted to the event and the shots being fired," Cameron said. "He pursued the shooter, engaged the shooter; during that engagement he fired a round at the shooter. Simultaneously, the shooter fired a round as well."The officer was not harmed, the sheriff said.The latest in a long string of deadly shootings at US schools and universities took place a little more than a month after 17 students and educators were shot dead at Marjory Stoneman Douglas High School in Parkland, Florida.That attack sparked a new student movement against gun violence, including a national school walkout last week that Great Mills students participated in. It occurred just days before a planned Saturday march in Washington calling for new restrictions on guns.Parkland students and Great Mills students exchanged supportive messages on Twitter following Tuesday's shooting."We are here for you, students of Great Mills, together we can stop this from ever happening again," Emma Gonzalez, a senior at Stoneman Douglas High School who survived last month's rampage, wrote on Twitter.A 14-year-old male student, whom the sheriff had earlier said was in critical condition, was in good condition after treatment at MedStar St Mary's Hospital, according to hospital officials. A 16-year-old female student, who also had been in critical condition, was stabilized and transferred to another hospital, they said.The shooter used a handgun in the attack, the sheriff said. He was confirmed deceased at 10:41 a.m. ET after being taken to a hospital.Cameron said investigators would determine whether the shooter died of a wound from the school resource officer's gun or in some other way.The public school's roughly 1,600 students were later escorted off campus by police, classroom by classroom, to reunite with their parents at another high school.Police investigated rumors that someone was threatening to shoot people at the school last month, BayNet, a Maryland news outlet, reported on Feb. 21. The threats were unsubstantiated, but security was increased at the school, the principal said, according to BayNet.It was unclear whether those rumors had any connection with Tuesday's violence."I'm not aware of anything, but again we're gonna go back and come through that as well as anybody involved (and) their social media posts," Cameron said in response to questions about the report.An armed school resource officer had also been on the campus of Stoneman Douglas at the time of the shooting there, and came under criticism for failing to stop the gunman, who was armed with an AR-15 assault-style rifle. The officer, who resigned, said he had not been sure where the gunfire was coming from.U.S. President Donald Trump and the National Rifle Association have proposed arming teachers to combat the threat of school shootings, while gun safety advocates have demanded a ban on semiautomatic rifles, among other laws.The Maryland school is in Great Mills, a community about 70 miles (110 km) south of Washington."You never think it'll be your school and then it is," Mollie Davis, who identified herself as a student at the school, wrote on Twitter. "Great Mills is a wonderful school and somewhere I am proud to go. Why us?"