Fox’s “American Idol” went out with a bang Wednesday night, performing as strongly as last year’s finale and again crushing everything in its path.

The intriguing matchup of Davids — 25-year-old David Cook defeated 17-year-old David Archuleta — generated a lot of interest in the competition’s closing week. The boffo numbers helped smooth out the rough edges in a season that had seen the juggernaut music competish lag behind year-ago ratings by 15% or more in some key demos.

Wednesday capped the season and May sweep, both won by Fox in the 18-49 demo for a fourth straight year. ABC ran second for the month, followed by CBS and a sputtering NBC. The Peacock finished closer to fifth-place Univision and sixth-place CW than to its major-network rivals.

Full-strength CBS and Fox, which was without “24” due to the writers strike, were down by 10% vs. last year, according to Nielsen. NBC, which was lacking “Heroes,” tumbled by 21%, while ABC (whose finales of “Grey’s Anatomy” and “Lost” will air post-sweep) slid by 17%.

Fox also won in younger demos as well as adults 25-54 (4.2/11), while CBS prevailed in total viewers (10.4 million to 10.0 million for Fox) for a sixth consecutive May sweep.

On Wednesday from 8 to 10:06 p.m., “American Idol” wrapped its seventh season with an 11.4 rating/30 share in adults 18-49 and 31.66 million viewers overall. The demo delivery was a tick below last season’s, while this year’s overall audience rose a bit (from 30.73 million). Wednesday rating was the second best of the season for “Idol,” behind only its premiere week in January.

Auds clearly knew when to expect the opening of the envelope, as viewership started at about 25 million in the 8 o’clock half-hour and peaked with more than 40 million in the final six minutes.

Perhaps the best bit of demographic news for “Idol” and Fox was that the show was able to recruit more teens to its season-ender: Finale’s 9.3 rating in teens 12-17 repped a 12% build over last year’s 8.3.

Show’s two nights finish as television’s top-rated series in adults 18-49 for a fifth straight season — an unprecedented achievement. “Idol” was also TV’s most-watched series overall for a third straight season.

With rival nets mostly surrendering with repeats from 8 to 10 p.m., “Idol” beat its combined ABC-CBS-NBC-CW competition by 14 shares in the key demos of 18-49, 25-54 and 18-34, and by 22 shares in teens 12-17.

CBS drama “Criminal Minds,” one of the only firstrun programs airing opposite “Idol,” was the night’s No. 2 program (3.4/8 in 18-49, 13.15m).

The 10 o’clock battle of firstrun dramas went to CBS’ “CSI: NY” (3.2/9 in 18-49, 11.83m) over NBC’s “Law & Order” (2.6/7, 8.57m) and ABC’s “Boston Legal” (1.6/4, 6.47m). The shows, each back next season, drew some of their lowest firstrun scores on record, and among young adults, “Law & Order” and “Boston Legal” were both beaten by TNT’s coverage of the NBA playoff game between Los Angeles and San Antonio (2.8/8, 6.19m).

For the month, Fox won by the largest margin of any network in a sweeps month (seventh-tenths of a ratings point) since Fox’s own victory in May 2006.

Elsewhere, Univision was a standout performer for the month, topping CBS, NBC and CW to rank No. 3 among all broadcasters in adults 18-34. And while the English-language broadcasters were down vs. May 2007 by a collective 18% in 18-34 rating, Univision was up 3%.

Univision also continues to perform especially well in cities with high Hispanic populations. In May its stations ranked No. 1 in adults 18-49, for example, in Los Angeles, Houston, Dallas and Phoenix — and No. 1 in adults 18-34 in both New York and San Francisco as well.

Leading the way were weeknight novellas “Al Diablo con Los Guapos” (Down With the Beautiful) and “Fuego en la Sangre” (Burning for Revenge) as well as reality/beauty competition “Nuestra Belleza Latina 2008.” “Fuego” became Univision’s biggest novella premiere to date when it bowed on April 28.

The sweep also saw fledgling broadcaster MyNetwork continue to inch upward in the ratings. It grew vs. its inaugural May sweep of a year ago by 25% in 18-49 rating (0.5 vs. 0.4) and by 27% in total viewers (1.19 million vs. 936,000).

Tuesday combo of “Jail” and “Street Patrol” were the top draws for MyNet, while new laffer “Under One Roof” saw some growth as the sweep progressed, averaging 1 million viewers.

All numbers are based on Nielsen’s “most current” data for the April 24-May 21 sweep. This includes final ratings for April 24-May 4 and preliminary data for May 5-21. Each adults 18-49 ratings point represents roughly 1.311 million viewers.