The 18-year-old King won raves for her rendition of the national anthem to start the weekend, then substituted Sunday for Williams and sealed the U.S. team's victory over Belgium.
King beat Kirsten Flipkens 4-6, 6-4, 7-5, giving the Americans an insurmountable 3-0 lead en route to a 5-0 victory.
Serena and Venus Williams won in singles Saturday, then became cheerleaders from the bench rooting for King.
"It's a great feeling, because they're champions I really look up to," King said. "It's really honoring."
Serena Williams pulled out a few hours before she was to face Flipkens, citing slight inflammation in the right knee. A team spokesman said the move was precautionary, and the inflammation was unrelated to the groin injury Williams sustained April 10, when she retired from a match in Charleston, S.C.
After King won, Venus Williams beat Yanina Wickmayer 6-1, 6-2. In doubles, King and Lisa Raymond beat Tamaryn Hendler and Caroline Maes 6-1, 6-2
The Americans will play Russia in the semifinals July 14-15 at a U.S. site to be determined. Russia advanced by beating Spain 5-0.
France and Italy also won 5-0 and will meet in the other semifinal.
King is a trained soprano and also the lone teenage American woman ranked in the top 100. But she's only 4-8 this year and said she began the match more nervous than when she sang the day before.
"It's a different feeling playing for yourself and playing for your country," the Californian said. "I felt like it's my responsibility to do the best I can for my country. It's not just about me anymore."
She was fitter at the finish against Flipkens, who battled leg cramps and repeatedly required massages during changeovers in the final set.
King was also a little lucky: A disputed line call went against Flipkens when she was serving for the match at 5-4, and on the next point she lost the game. Flipkens said she received several messages from supporters after the match saying the ruling was wrong.
"That's life. That's tennis. People make mistakes," she said. "That one point didn't make the match."
In the final game a gimpy Flipkens double-faulted and committed three unforced errors, and King whacked a forehand passing shot for a winner on the second match point.
That earned the teen a hug from U.S. captain Zina Garrison, and the team began a flag-waving celebration.
"I felt like after the first set I loosened up a little bit," King said. "The whole team was there behind me and cheering me on, and Zina was always pumping me up, trying to keep me positive and fighting hard. So thanks to them."
The match was entertaining but sloppy, with the timing of both players thrown off by wind so strong it blew a ball can past the baseline. They waged long rallies that occasionally evolved into an exchange of moonballs, but both also came to the net for frantic exchanges.
The match turned when King won the final four points of the second set to pull even. Flipkens double-faulted on break point.
Belgium was without its top players, top-ranked Justine Henin and No. 4 Kim Clijsters, who decided to take the week off.