William and Kate sit courtside at Boston Celtics game during US trip

They are in the States to promote the Prince's environmental Earthshot Prize.

William and Kate sit courtside at Boston Celtics game during US trip Getty Images

The Prince and Princess of Wales made a surprise appearance at an NBA game as they sat courtside to watch the Boston Celtics take on the Miami Heat.

They took in the contest at the TD Garden in Boston on Wednesday evening, with the home side defeating Miami by 134-121.

Their three-day trip to Boston is the first time that William and Kate have travelled to the US in eight years.

At the NBA game, they stood for the US national anthem, though were booed by small pockets of the crowd after they were introduced by a stadium announcer and shown on the big screen.

They are in the States to promote the Prince’s environmental Earthshot Prize.

The second annual Earthshot Prize ceremony will take place in Boston on Friday.

William and Kate’s visit to the US comes amid a row over the future King’s godmother.

Lady Susan Hussey resigned from her role in the royal household and apologised after asking Ngozi Fulani, a prominent black British-born domestic charity boss, where she “really came from” during a Buckingham Palace reception.

A Kensington Palace spokesman told reporters in the US: “Racism has no place in our society.”

The prince is understood to agree that it was right for Lady Susan to step down from her honorary role as one of three Ladies of the Household.

On Thursday, William and Kate will visit Greentown Labs, a tech hub which has been nurturing climate pioneers for more than a decade.

They will also tour Roca, a non-profit organisation focusing on young people at risk of urban violence.

The couple will meet with leaders of the organisation to learn about their intervention model and spend time with women in the young mothers’ programme, current members and alumni of the young men’s programme.