Bernie Sanders - who said he was "sickened" by the "despicable act."
The attack provoked a wave of emotion on Capitol Hill, where Republicans and Democrats expressed concern over a possible rise in verbal or physical violence amid a bitterly partisan political atmosphere in the aftermath of a vitriol-filled 2016 election.
In a national address, Trump appealed for unity following the morning assault in the Washington suburb of Alexandria, Virginia.
"We are strongest when we are unified and when we work together for the common good," said the president.
Congressman Steve Scalise - the number three Republican in the House of Representatives and a strong supporter of US gun rights - underwent surgery after being shot in the left hip.
He needed several blood transfusions, remains in critical condition and will require more operations, MedStar Washington Hospital Center said late Wednesday.
"The bullet traveled across his pelvis, fracturing bones, injuring internal organs, and causing severe bleeding," a statement said.
The others shot and wounded were a congressional aide, a lobbyist for Tyson Foods, and a US Capitol Police officer.
A second Capitol police officer suffered non-gunshot injuries, the FBI said. Two congressman said they had sustained minor injuries while trying to take cover.
'Pray for Steve'
The president and First Lady Melania Trump later visited Scalise, bringing flowers.
"Just left hospital. Rep. Steve Scalise, one of the truly great people, is in very tough shape - but he is a real fighter. Pray for Steve!" Trump tweeted.
The FBI said it had recovered and was attempting to trace two weapons, a rifle and a handgun, and was actively investigating Hodgkinson's "associates, whereabouts, social media impressions, and potential motivations."
According to his Facebook page, Hodgkinson was a fervent supporter of Sanders, the feisty independent who battled Hillary Clinton for the Democratic presidential nomination last year.
The gunman's social media posts displayed strong anti-Trump sentiment.
"I know he wasn't happy with the way things were going, the election results and stuff," his brother, Michael Hodgkinson, told The New York Times.
Sanders swiftly responded to reports the suspect had volunteered on his presidential campaign.
"I am sickened by this despicable act," he said.
"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."
'Run, he's got a gun'
Despite the shooting, the annual congressional baseball game will go ahead Thursday as planned at Nationals Park.
"It will be play ball tomorrow night at 7:05," Congressman Joe Barton, manager of the Republican team, said at a news conference with Mike Doyle, the Democratic team manager.
Doyle put his hand on Barton's shoulder several times as the Republican, who was at the practice with his son, recalled the horror of realizing that friends and co-workers were under attack.
"You know, it shouldn't take an incident like this to bring us together," Doyle said.
After an all-members briefing where Democrats and Republicans held hands and prayed, House Speaker Paul Ryan and top Democrat Nancy Pelosi addressed the somber chamber and proclaimed lawmakers were "united."
Democrats, advocates of stronger gun control legislation, appeared reluctant to reopen the debate but Trump supporter and former House speaker Newt Gingrich denounced what he said was "the increasing intensity of hostility on the left".
The last gun attack against a member of Congress was in January 2011 in Tucson, Arizona, when Gabrielle Giffords, a Democrat, was shot in the head but survived an assault that killed six people.
Wednesday's shooting took place just after 7:00 am (1100 GMT) as the Republican team practiced for the charity showdown.
Congressman Rodney Davis told CNN he was at the plate at the time, and Scalise was in the field at second base.
"I was batting, we heard a loud noise.... The next thing I remember was somebody on the field yelling, 'Run, he's got a gun.'"
Alexandria police chief Michael Brown said his officers arrived within minutes and engaged Hodgkinson, together with Capitol Police officers. The gunman was taken into custody and later died of his injuries.
Gun rights advocate
Lawmaker Jeff Duncan said he was leaving the practice when he was approached by a man he later learned was the shooter, who asked if the team was Republican or Democrat before heading toward the field.
"I'm shaken up," Duncan said. "My colleagues were targeted today by someone that wanted to kill them."
Barton had arrived at the US Capitol still wearing his red baseball uniform.
"The heroes are the police officers who attacked the shooter, and in doing so quite probably saved many, many lives."
Scalise, a conservative from the southern state of Louisiana, backs arms rights and last month introduced legislation that relaxes restrictions on interstate gun sales.
Several Democrats were practicing at a different field when they heard of the shooting, and immediately gathered to pray for their wounded colleague.
Democrat Nanette Barragan said it will be "bittersweet" when she takes the field for her first congressional baseball game Thursday.
"We're going to look over our shoulder a little bit," she said.