Greg Howes scored two goals, and Brett Phillips made 20 saves as the heavily favored Ticos outshot the Americans, 41-12, and took 17 corner kicks but were unable to find the net.
Cuba also qualified for the Nov. 21-Dec. 5 finals in Chinese Taipei, beating Mexico, 5-4, in the other semifinal before 2,741 at the Palacio de los Deportes.
The Americans and Cubans, who tied, 1-1, in Wednesday's Group B finale, will meet in Saturday's CONCACAF championship.
''[The U.S. players] believed in the game plan, and they went out and executed a game plan from the beginning to the end,'' U.S. coach Keith Tozer said. ''This team didn't think about the outcome. That was the amazing thing. They all thought about their responsibilities.
''This is such a huge victory, not only for U.S. Futsal, but for U.S. Soccer in general. To come down to play a highly regarded team in their own building, in their own country, and to beat them, 4-0, is an amazing feeling. It's an experience that I am going to remember for the rest of my life.''
The U.S. squad's defensive gameplan, backed by Phillips' performance, frustrated Costa Rica, which fired off target on nine of its first 11 shots.
The Americans went ahead in the eighth minute as Andy Guastaferro converted a penalty kick for the third successive game.
Howes made it 2-0 in the 28th minute, nearly midway through the second half, from a Phillips pass. His shot deflected off a Tico defender en route to the net.
Howes' second goal, in the 37th minute, arrived after Costa Rica had pulled its goalkeeper in favor of a fifth attacker. A Tico rebound fell to Howes, who fired nearly the length of the field into an open net.
Howes set up Shankar a minute later for a 4-0 advantage.
''This is the pinnacle of what you play for, especially for us,'' said Lee Tschantret, who served as captain in injured Sean Bowers' absence. ''We are going to a World Cup. We are going to Taipei, and it feels great. We battled, and the atmosphere tonight was unbelievable. It was just 12 guys who really came together and battled.
''We handled all kinds of adversity. Sean was hurt; John [Ball] missed a couple of games [under suspension]. We really pulled together over the last three or four days. It was unbelievable; it's a great feeling.''
The United States finished third at the 1989 world championship, second in 1992 and 10th in 1996 but failed to qualify in 2000, when Costa Rica and Cuba joined host Guatemala as CONCACAF representatives. Brazil won the first three world titles and lost to Spain in the 2000 title game.
Futsal is a cousin of North American indoor soccer, featuring five-player teams on a basketball-like court with no walls and a low-bouncing ball. Indoor soccer features six-player teams and side- and backwalls on a hockey rink-sized field.
CONCACAF QUALIFYING TOURNAMENT
July
23-31 at Heredia, Costa Rica
U.S. Schedule
July 24: United States 2 Panama 2
July 26: United States 6 Guyana 0
July 28: United States 1 Cuba 1
July 30:
Semifinals -- United States 4 Costa Rica 0
Aug. 1: Final vs. Cuba
Group A
W L T GF GA Pts
x-Costa Rica 3
0 0 23 2 9
x-Mexico 2 1 0 12 13 6
Trinidad & Tobago 1 2 0 12 16 3
Suriname
0 3 0 10 26 0
x - qualified for semifinals
Friday, July 23
Mexico 6 Trinidad & Tobago 4
Costa Rica 13 Suriname 1
Sunday, July
25
Mexico 6 Suriname 5
Costa Rica 6 Trinidad & Tobago 1
Tuesday, July 27
Costa Rica 4 Mexico 0
Trinidad & Tobago 7 Suriname 4
Group B
W L T GF GA Pts
x-Cuba 2 0 1 13 4 7
x-United States 1 0 2 9 3 5
Panama
1 1 1 10 7 4
Guyana 0 3 0 6 24 0
x - qualified for semifinals
Saturday, July 24
United States
2 Panama 2
Cuba 10 Guyana 3
Monday, July 26
United States 6 Guyana 0
Cuba 2 Panama 0
Wednesday, July 28
United States 1 Cuba 1
Panama 8 Guyana
3
Semifinals
Friday, July 30
Costa Rica 0 United States 4
Cuba 5 Mexico 4
Third Place
Saturday, July 31
Costa Rica vs. Mexico
Championship
Saturday, July 31
United States vs. Cuba
Note: Semifinal winners advance to Nov. 21-Dec. 5 FIFA Futsal World Championship in Chinese Taipei