ALEXANDRIA, VA. - A gunman opened fire on a Republican congressional baseball team practicing on a suburban Virginia field Wednesday, wounding Louisiana congressman Steve Scalise and shooting four other people as horrified legislators and staffers scrambled for cover amid a hail of bullets.

Capitol Police, who provided security for the practice, engaged the shooter, identified by authorities as James Hodgkinson, 66, from Belleville, Ill. President Trump later said the suspect was killed in the ensuing shootout.

Congressional aide Zachary Barth, Tyson Foods lobbyist Matt Mika, and Capitol Police special agents Crystal Griner and David Bailey also were wounded in the rampage. The agents were hailed as heroes.

President Trump made a surprise visit on Wednesday to the hospital where Scalise is being treated.

"Many lives would have been lost if not for the heroic actions of the two Capitol Police officers who took down the gunman despite sustaining gunshot wounds during a very, very brutal assault," Trump said. "Melania and I are grateful for their heroism and praying for the swift recovery of all victims."

Rep. Mo Brooks, R-Ala., was standing on the third base line and was about to take batting practice when he heard a loud bang behind him. He turned and saw, past a dugout, a middle-aged man pushing a rifle through the chain-link fence, firing toward second base and the outfield.

“He was not saying anything,” Brooks said. “He was just blasting away with his gun, shooting rapidly.”

Rep. Chuck Fleischmann, R-Tenn., said the baseball practice session was almost over when the rampage began on the field shortly after 7 a.m. “I heard a bang, and I thought it sounded like a gun. I never saw a shooter," he said. "I got bloody running and jumping into the dugout.”

Fleischmann estimated there were 50 to 60 people at the practice, including House members, senators and their staff. “Many have been shot, but a lot like me got bloody running for cover,” he said.

“It is just a madhouse here,” Fleischmann said. “It’s horrible. I’ve never experienced anything like that.”

St. Clair County, Ill., Sheriff Richard Watson said Hodgkinson is believed to have left his Illinois home four or five weeks ago and had been in the Alexandria area since then.

Deputies last encountered Hodgkinson at his Belleville, Ill., home on March 24, when a neighbor reported gunshots fired in the area, Watson said. Deputies found Hodgkinson with a hunting rifle on his property where he was apparently engaged in target practice, Watson said.

“The guy was very cordial,’’ the sheriff said. “He showed the deputy his firearms identification card. Even though he was on his own property, he told the deputy that he probably should take the rifle to a gun range, just to be safe.’’

On Wednesday morning, South Carolina Rep. Jeff Duncan said he was leaving practice early when the man he believes was the gunman asked him if the players were Democrats or Republicans.

"I told him they were Republicans, he said 'OK, thanks,' and turned around," Duncan told reporters. "I got in the car and left."

Minutes later he heard about the rampage.

Tim Slater, an FBI special agent in charge of the investigation, said it was too early to say if the shooter was targeting Republicans. Hodgkinson, however, had a history of raging online against President Trump and other Republicans and once singled out Scalise.

"Here's a Republican that should lose his job, but they gave him a raise,'' Hodgkinson allegedly wrote in a 2015 post to his Facebook account. The message was accompanied by a cartoon depiction of Scalise.

In a March 22 Facebook post, Hodgkinson described Trump as a "traitor.''

Former Alexandria Mayor Bill Euille said Wednesday that he remembers meeting Hodgkinson more than a month ago at the YMCA, adjacent to the baseball field where the attack occurred.

Euille said that Hodgkinson referred to him as “Mr. Mayor’’ and that he would regularly see him at a table at the Y, drinking coffee and using his laptop. He said it didn't occur to him that the man was the shooter until he saw his photograph in media accounts.

Sen. Bernie Sanders issued a statement saying the suspect apparently had volunteered on his presidential campaign. Sanders said he was "sickened by this despicable act."

"Let me be as clear as I can be. Violence of any kind is unacceptable in our society and I condemn this action in the strongest possible terms," Sanders said. "Real change can only come about through nonviolent action, and anything else runs against our most deeply held American values."

Scalise, the third-ranking GOP whip in the House, was shot in the hip and listed in critical condition after surgery at MedStar Washington Hospital Center.

"Prior to entering surgery, the Whip was in good spirits and spoke to his wife by phone," his office said in a statement. "He is grateful for the brave actions of U.S. Capitol Police, first responders, and colleagues."

Rep. Roger Williams, R-Texas, said his staffer Barth was among the wounded and was in stable condition. U.S. Capitol Police Chief Matthew Verderosa said the wounded officers were in good condition. Mika was shot several times and was in critical condition, his family said in a statement.

The team of Republican congressman and staff members were practicing for a charity baseball game scheduled for Thursday against a Democratic team.

Pennsylvania Rep. Patrick Meehan said he had been joking and talking trash to Ohio Democrat Tim Ryan since striking him out on a curveball last year. "He just came up and gave me a hug," Meehan said.

Rep. Jared Huffman, D-Calif., said his team was practicing elsewhere when they heard about the attack. "We're safe & with police, everyone praying for GOP colleagues, staff & Cap police," Huffman tweeted.

The shooting took place at Eugene Simpson Stadium Park, in the Del Ray section of Alexandria about seven miles from the Capitol. It's a quiet community made up of restaurants, small businesses and lots of families. Residents describe it as a safe neighborhood where people walk around outside until late at night. The field serves as a community hub, with games and activities at all hours.

The special agents were providing security at the practice and quickly returned fire when the shooting began, Verderosa said. Alexandria Chief Michael Brown said his officers arrived three minutes after the first emergency call came in at 7:09 a.m. ET, and also joined the gunfight.

Sen. Rand Paul said he was "shaken but unharmed" after the rampage.

"Many people likely would have died this morning if not for the bravery of the Capitol Police," Paul said. "My thanks to them are inadequate but heartfelt. They never hesitated to put their lives on the line to save everyone."

Rep. Mo Brooks, R-Ala., told CNN people scattered when the shooting began. Scalise was standing in the infield and fell where he stood.

"He was not able to move under his own power. He was dragging his body from second base," Brooks said. "There was not a whole lot we could do."

"It's not easy when you see people around you being shot and you don't have a weapon yourself," Brooks added. "You feel helpless."