US President Donald Trump has offered condolences at the Pennsylvania synagogue where 11 Jewish worshippers were shot dead at the weekend.
He was joined by First Lady Melania Trump, his daughter and son-in-law at the Tree of Life temple in Pittsburgh.
Hundreds of protesters gathered on the street chanting slogans against the president.
The visit came as mourners attended the first funerals for victims of the massacre.
The Trumps were greeted on Tuesday by Rabbi Jeffrey Myers, who led them inside the temple, where the worst anti-Semitic attack in US history unfolded on Saturday.
At a memorial outside, Mrs Trump placed a flower and the president laid a small stone on a marker for each of the victims.
Mr Trump was joined by his son-in-law Jared Kushner, who is Jewish, and his daughter Ivanka, who converted to Judaism when she married Mr Kushner. Both are White House advisers.
Treasury Secretary Steven Mnuchin, who is Jewish, also joined the president.
Before his visit, the president condemned anti-Semitism. The alleged gunman was not a Trump supporter.
Critics accuse Mr Trump of fomenting a surge in white nationalist and neo-Nazi activity through divisive rhetoric which has seen him criticise immigrants and Muslims in particular.
Some Jewish figures and Pittsburgh's Democratic Mayor Bill Peduto opposed the presidential visit.
More than 70,000 people signed an open letter from Pittsburgh-based Jewish leaders saying that President Trump was "not welcome" in the city unless he "fully denounces white nationalism".
The top four Republican and Democratic congressional leaders declined a White House invitation to join Mr Trump in Pennsylvania.
The White House has rejected any blame over the attack.
Members of Pittsburgh's Jewish community were among about 2,000 demonstrators who held a protest, according to Reuters news agency.
As the president was driven through Pittsburgh, some bystanders made obscene gestures to his motorcade and thumbs-down gestures, reports AP news agency.
They held signs with such slogans as "We build bridges not walls"; "Trump, Renounce White Nationalism Now"; and "Trump's lies kill".
During the presidential visit, one protester holding a baby was seen by reporters calling out: "We didn't invite you here."
Earlier on Tuesday, mourners paid their respects to four victims of the massacre.
Brothers David and Cecil Rosenthal, who were aged 54 and 59, were among the first to be buried. They were the youngest victims of the shooting.
During a packed prayer service for the siblings, Rabbi Myers said: "They could illustrate a dictionary definition for 'pure souls'."
Daniel Stein, 71, and Jerry Rabinowitz, 66, were also laid to rest.
Mr Rabinowitz was a doctor, known for his work with gay men diagnosed with HIV. On Saturday, he was shot and killed after he rushed to help the wounded, his nephew Avishai Ostrin said in an emotional Facebook post.
Support for the community has been pouring in from across the country.
A GoFundMe page created by an Iranian refugee studying in Washington DC, who has no connection to the Pittsburgh community, has already accumulated $900,000 (£700,000) to help rebuild the synagogue and support victims' families.
Another fund set up by Muslim-American groups to help pay for funeral costs has raised $200,000.
Robert Bowers, 46, is now in the custody of US marshals and faces 29 criminal charges.
He was discharged from hospital on Monday after being treated for multiple gunshot wounds.
During his first court appearance on Monday, Bowers waived his detention hearing and requested a public defender, US media reported.
A further hearing has been scheduled for 1 November.