WASHINGTON — President Barack Obama cast a string of legal and legislative victories last week on trade, health care and gay marriage as the “gratifying” culmination of years of work by his White House.

Obama made particular note of the crowds that gathered outside the White House Friday night to witness the executive mansion bathed in rainbow lights, the symbol of the gay rights movement.

“That made it a really good week,” Obama said during a news conference with Brazilian President Dilma Rousseff. “To see people gathered in the evening outside on a beautiful summer night and to feel whole and to feel accepted and to feel that they had a right to love, that was pretty cool.”

His only regret? Security procedures kept him from going outside to catch a glimpse of the light display and the crowds himself.

The Supreme Court’s gay marriage ruling capped a week that also saw the justices preserve a key provision of Obama’s heath care law and Republican lawmakers champion passage of his bid to get fast-track authority for an Asia-Pacific trade deal. The president also spoke emotionally about race and gun violence at a funeral service in Charleston, South Carolina, for one of the nine people slain at a black church.

Seeking to build on one of the best weeks of his presidency in some time, Obama ticked through a wish-list of agenda items he now hopes to pursue. Among them: infrastructure spending, job training programs, and criminal justice reform.

On the latter, Obama said he was intrigued by leadership from “some very unlikely Republican legislators,” a reference to congressional Republicans who have pushed for criminal justice reform, including Kentucky Sen. Rand Paul, a 2016 presidential candidate.

Still, the president appeared realistic about his ability to turn a good week into further progress, conceding that some of his policy priorities “will be left undone” when he leaves office.