WASHINGTON — The top two Democrats in Congress, seeking to ramp up pressure on Republicans to pass legislation extending background checks to all gun buyers, told President Trump on Sunday that they would join him at the White House for a “historic signing ceremony at the Rose Garden” if he agreed to the measure.

The offer, made by Speaker Nancy Pelosi and Senator Chuck Schumer of New York, the Democratic leader, during an 11-minute phone conversation with Mr. Trump, comes as the president is considering a package of measures to respond to the mass shootings that have terrorized the nation in recent months. The three spoke only about gun legislation, according to aides.

Judd Deere, a White House spokesman, said in a statement that the conversation was cordial but that Mr. Trump “made no commitments” on a House-passed background checks bill that Ms. Pelosi and Mr. Schumer are urging him to support.

Mr. Trump “instead indicated his interest in working to find a bipartisan legislative solution on appropriate responses to the issue of mass gun violence,” Mr. Deere said.