In a tense battle, Welshman Williams won the final two frames to finally shake off the challenge of Carter, who had led 3-1 before Williams took three in a row to turn the match around.
In the first frame, Carter got the best of a safety contest and made a break of 53 to win it before taking the second frame too.
Williams took his first frame thanks to a lucky shot, a misplayed safety that instead set him up for the final red and a shot at the black which he took. However, he could not respond to Carter's break of 58 in the next as he fell 3-1 behind. Williams began to find his range in the fifth frame, taking advantage of an error from Carter to cut the gap back to one frame.
And he then drew level with a break of 66, the highest of the match so far, to make it 3-3. A break of 62 helped Williams take a 4-3 lead before Carter responded to tie it once again at 4-4.
Williams looked to be cruising in the ninth frame until missing a black. However, Carter could not capitalise, and Williams won the tenth frame to wrap up victory.
Earlier, Ding knocked out Mark Allen, who went down 6-2 to the Chinese favourite.