President Biden said on Thursday that he and Prime Minister Benjamin Netanyahu of Israel were headed toward a “come-to-Jesus meeting” over the humanitarian crisis in Gaza, according to an audio clip of the president’s remarks posted on social media on Friday.

Mr. Biden’s comment highlights the rising tensions between him and Mr. Netanyahu in recent weeks, as the civilian death toll in Gaza has risen inexorably and Mr. Biden has come under political pressure at home and abroad to do more to compel Israel to agree to a cease-fire.

In recent days, Mr. Biden had expressed hope that at least a six-week cease-fire deal would be in place by Ramadan, the Muslim holy month that starts in a few days. But Israel and Hamas have reached an impasse in negotiations to recover vulnerable hostages taken during the Oct. 7 attack in Israel in exchange for a permanent cease-fire and the withdrawal of Israeli troops from Gaza.

On Friday, when asked by reporters if a deal could still be reached by Ramadan, Mr. Biden said, “It’s looking tough.”

The president’s earlier “come-to-Jesus” comments were captured on a hot microphone during what Mr. Biden thought was a private exchange with Senator Michael Bennet, Democrat of Colorado, after the State of the Union address.

According to a recording of the conversation, Mr. Bennet encouraged the president to “keep pushing” on the issue of humanitarian assistance to Gaza as Israel fights its war against Hamas, a war for which the United States has provided funding and weaponry.

“I told him, ‘Bibi’ — don’t repeat this — I said, ‘You and I are going to have a come-to-Jesus meeting,’” Mr. Biden said, referring to the prime minister by his nickname.

Mr. Biden was informed by an aide that his microphone was still on and that the conversation was being recorded. “I’m on a hot mic here?” Mr. Biden said. “Good. That’s good.”

Mr. Biden had just used his prime-time address to Congress to forcefully call on Israel to curtail civilian casualties and to allow greater quantities of food, medicine and other aid into the besieged enclave. Gazan health authorities say 30,000 have been killed in the Israeli offensive on Gaza, most of them civilians. Millions of residents have been displaced, and hundreds of thousands more are facing starvation.

“Israel also has a fundamental responsibility, though, to protect innocent civilians in Gaza,” Mr. Biden said in his speech. “This war has taken a greater toll on innocent civilians than all previous wars in Gaza combined.”

Mr. Biden strongly backed Israel’s right to invade Gaza after Hamas fighters crossed the border on Oct. 7 and killed more than 1,200 Israelis, according to Israeli authorities, in border towns, while committing atrocities and taking hostages.

The United States has continued to supply Israel with weapons and block U.N. resolutions demanding a cease-fire, backing Mr. Netanyahu’s stance that a permanent cease-fire would be a victory for Hamas, which the United States regards as a terrorist group.

But the civilian toll of Israel’s bombing campaign, coupled with rising levels of hunger and disease in Gaza, has provoked international outrage, and calls have grown for the United States to use its influence with Israel to bring about a cease-fire. At home, Mr. Biden has faced a rebellion on the issue from left-leaning Democrats and Arab Americans who were important to his winning coalition in 2020, notably in the battleground state of Michigan.

Mr. Biden’s speech on Thursday seemed aimed in part at mending those fences. He also announced that the U.S. military would build a floating pier off Gaza.

“To the leadership of Israel, I say this: Humanitarian assistance cannot be a secondary consideration or a bargaining chip,” Mr. Biden said in his address. “Protecting and saving innocent lives has to be a priority.”

Mr. Biden slyly acknowledged his comment to Senator Bennet when asked about it before boarding Air Force One on Friday. “I didn’t say that in the speech,” he said. But when asked about comments after the speech, Mr. Biden told reporters, “You guys are eavesdropping on things.”