President Obama on Tuesday encouraged Americans to reach out and help Louisiana in its recovery efforts from flooding that has ravaged the state for the last few weeks.

“You’re not alone on this even after the TV cameras leave...the whole country is going to continue to support you and help you,” Mr. Obama said in a statement during a visit to Baton Rouge.

“I know how resilient the people of Louisiana are and I know that you will rebuild again,” he added. “I’m asking every American to do what you can to help get families and local businesses back on their feet.”

Get Breaking News Delivered to Your Inbox

The president said that Americans should stay focused on Louisiana even after the disaster fades from the spotlight because federal assistance won’t be enough.

“Once the floodwaters pass, people’s attention spans pass. This is not a one-off,” said Mr. Obama, who said that Americans should make sure that the state is still being helped three to six months from now. “I need all Americans to stay focused on this.”

More than $120 million in approved federal aid has flowed to the state over the last two weeks, White House spokesman Josh Earnest told reporters Tuesday. Funding will be used for temporary rental assistance, home repairs and flood insurance, the president said.

Mr. Obama’s remarks came after he met with residents and toured areas of Baton Rouge hit by the floods.

“The prayers of the entire nation is with everybody who lost loved ones,” he said. “We are heartbroken by the loss of life.”

The president had come under fire from Donald Trump and other Republicans for not cutting his Martha’s Vineyard vacation short and visiting Louisiana sooner.

“President Obama should have gone to Louisiana days ago, instead of golfing. Too little, too late!” Trump tweeted Tuesday.

Asked if Mr. Obama has been annoyed or dismayed by people playing politics with the relief effort, Earnest said, “I think the president is used to people trying to score political points even in situations where they shouldn’t. The president certainly believes this is the kind of situation where...we’re talking about lives lost. We’re talking about a community being upended. And [he believes] that it’s an appropriate time to put politics aside, and actually focus on our responsibilities as Americans.”

Trump visited the region on Friday with his vice presidential nominee Indiana Gov. Mike Pence.

Democratic presidential nominee Hillary Clinton said in a statement Monday that she plans to visit the flood-ravaged areas, but do it when it won’t disrupt the recovery efforts.

“I am committed to visiting communities affected by these floods, at a time when the presence of a political campaign will not disrupt the response, to discuss how we can and will rebuild together,” she said.