HOLLYWOOD — NBC was still sprinting at the finish line, capping a strong May sweep with another powerful Wednesday perf behind the season finales of “Ed” and “Law & Order.”

The final night of the season also saw a monster turnout for UPN’s series finale of “Star Trek: Voyager,” a solid but unspectacular wrap for Fox’s “Boot Camp” and more mild marks for ABC’s comedies.

The Peacock web, which tied its own record this month (set in the 1980s) with a seventh straight May sweeps victory in adults 18-49, took the month by the largest margin for any sweep winner in the last two seasons. Net topped runner-up Fox by eight-tenths of a ratings point (5.1/15 vs. 4.3/12) after winning the February sweep by two-tenths and November 2000 by six-tenths.

UPN improved its May marks nicely with Wednesday’s two-hour series finale of “Voyager,” which won its 8-10 p.m. block in several of Nielsen’s biggest metered-markets, including New York (11.8/17) and San Francisco (10.8/17).

“Voyager” (8.81m, 4.6/13 in adults 18-49) gave UPN its second biggest night ever — behind only the show’s series premiere in January 1995 — and led the net to a second-place demo finish on the night. Big night also enabled UPN to pull even with last May’s performance in adults 18-49 and to move ahead of the WB in overall audience for the month.

CBS long ago wrapped things up as the month’s most-watched network for the first time in 18 years.

Web, powered by “Survivor: The Australian Outback” as well as “CSI: Crime Scene Investigation” and its Monday comedies, topped No. 2 NBC by more than half a million viewers after finishing third a year ago. It also moved up to second in adults 25-54, women 25-54 and women 18-49.

And in adults 18-49, it finished ahead of one of the other three major nets (ABC) in a sweep for the first time since February 1998 — and for the first time without Olympics help since November 1994, when it topped Fox.

ABC, which won all three sweeps in adults 18-49 last season (tying with NBC in May 2000), finished fourth in a sweep for the first time ever. The Alphabet finished no higher than third in any major category, including overall audience, a measure it won by nearly 3 million viewers a year ago.

Fox’s best May ever

Fox finished second in adults 18-49 with its most competitive May sweep ever — eight-tenths behind NBC. It also enjoyed its most competitive May in adults 18-34, coming up a tick short of catching NBC for what would have been its first May win by this measure.

The net racked up strong demo finishes for the month, including first-place in men 18-49, men 18-34, male teens and total teens. It also placed second in women 18-34, men 25-54 and female teens.

The WB, which showed the most consistent year-to-year growth of any net throughout the season, shined in May as well.

Frog net was up 18% vs. last May in adults 18-34 (to 2.0/6) and 23% in women 18-34 (to 2.7/8). Wednesday’s season finales of “Dawson’s Creek” (4.85m, 2.5/7 in A18-49) and “Felicity” (3.86m, 2.0/5) improved by about 10% vs. last year’s finales.

Elsewhere on the final night of the season, NBC won by 4 shares over second-place Fox in adults 18-49 (6.1/17 vs. 4.5/13) and by 5.4 million viewers over second-place ABC in overall audience. It was the net’s 13th nightly demo victory in the sweep.

“Law & Order” won both of its hours with original episodes from 9 to 11, led by a commanding 11-share demo victory at 10 for its season finale (20.03m, 8.2/22 in A18-49). It ended the sweep with the highest adults 18-49 (6.8/18) and total viewer (17.7 million) averages in its 11-year history.

“Ed” ended its first season on a high note as well, winning its hour in adults 18-49 (4.1/12) and total viewers (9.95m).

Fox won the night’s opening half-hour with a repeat of “That ’70s Show” (4.1/13 in A18-49), placed third at 8:30 with “Grounded for Life” (3.9/11) and second at 9 with the season finale of “Boot Camp” (5.1/13).