TAORMINA, Sicily — President Trump declined to endorse the Paris climate accords on Saturday, ending his first foreign trip much as he began it: at odds with several of the nation’s allies and under a cloud of questions back home about his ties to Russia.

Mr. Trump refused to bend on the pact after three days of contentious private debate and intense lobbying by other leaders that began Wednesday with an appeal by Pope Francis. The six other nations in the Group of 7 reaffirmed their commitment to cutting greenhouse-gas emissions in a joint statement issued Saturday.

The stalemate leaves the country’s future role in the climate accord in flux, though Mr. Trump promised to make a decision in the week ahead on whether the United States will be the first of 195 signatories to pull out.

Mr. Trump returned home on Saturday night to a White House in crisis after a nine-day trip to the Middle East and Europe that was book-ended by new disclosures about links between his aides and Russia.