It is a busy weekday afternoon on the D train. Hispanic teenagers board in the Bronx, joking in Spanish. Then a stop in midtown Manhattan sends office workers rushing aboard. The scene changes again, as the train rumbles southeast into Brooklyn: African Americans, Asians and Russian immigrants stream in.

The D train, like its alphabetic and numeric counterparts across the city, is a cross section of humanity -- an unwitting, usually unnoticed celebration of a diverse city.

"You're going through four boroughs and God knows how many neighborhoods for just $2," subway historian Stan Fischler said. "How could you possibly find a better way to bring cultures together than the subway?"

Above ground, New York is a city of skyscrapers and streets teeming with pedestrians and cars. Below the surface is the Big Apple's nervous system: the subway, 722 miles of rumbling, grumbling metal.

On Wednesday, it will be a century old.

Almost from the first subway trip in 1904, when a fare cost a nickel, the trains began to stitch together neighborhoods, essentially creating the city north of Midtown and linking it with far-flung areas of Brooklyn, the Bronx and Queens.

Today, New York's subway has more miles of track than any other underground transit system. It whisks 4.5 million passengers daily throughout the city.

"For New Yorkers," said Jonathan Marfey, 39, exiting an F train at Roosevelt Island, "it's part of life."

Dozens of exhibits, events and testimonials celebrate the subway centennial. An exhibit at the Museum of the City of New York shows off subway photography. Other events upcoming include the crowning of "Ms. Subways" on Monday and a "Grand Finale Jam" concert at Grand Central Terminal on Wednesday.

Even vintage trains will be rolled out for rides recalling earlier days of a system that, at its best, has been an example of municipal efficiency -- carrying 1.4 billion riders a year -- and, at its worst, has been a graffiti-marred symbol of urban decay.

The inaugural trip carried then-Mayor George B. McClellan Jr. 9.1 miles from downtown Manhattan to 145th Street. "City Hall to Harlem in 15 minutes!" amazed city fathers exclaimed.

That 1904 milestone came after workers spent four years digging tunnels 55 feet wide and 15 feet high, while pumps drew out rainwater. The system has always been an engineering marvel. Subway lines were carved through bedrock, granite and quicksand. An innovation known as "cut and cover" allowed streets to be excavated, tunnels constructed and streets then restored.

Several private transit companies -- with such names as the Interborough Rapid Transit Company (IRT) and the Brooklyn- Manhattan Transit Company (BMT) -- grew in the first few decades of the century. The trains allowed immigrants crowded on the Lower East Side of Manhattan to create their own neighborhoods in once-faraway places.

"One of the important things the subway did was to disperse the population and accelerate growth in the outer boroughs," said Charles Sachs, senior curator of the New York Transit Museum.

Changes in population statistics between 1910 and 1940 tell the story. The population of the Lower East Side dropped 63 percent. Coney Island, in the nether reaches of Brooklyn, experienced a 921 percent gain. Jackson Heights, in Queens, went up 507 percent, and the eastern Bronx jumped 566 percent.

Even though subway trains were carrying 8 million riders a day by 1946, economic woes had already bankrupted the IRT and BMT, forcing the city to take them over. By 1953, the fare went up to 15 cents a ride. (This led to the introduction of subway tokens, because turnstiles, in operation for three decades, would not accept nickels and dimes together.)

Managing and paying for the ever-growing system -- which now costs nearly $5 billion a year, including buses -- has been a consistent challenge. And the subway's low point also marked a low point for the city's image.

In 1966, a 12-day transit strike crippled New York. Decline continued through the 1970s and into the '80s, when the system became known for crime and graffiti-covered trains. At times, as much as a third of the subway fleet was out of service.

Beginning in 1982, the Metropolitan Transportation Authority, the state agency that took over the subway system in 1968, began a major rebuilding drive. Trains were eventually cleaned, stations were rehabilitated and faulty tracks were torn up and re-laid. More than $39 billion has been spent on the system's rehabilitation.

"Once graffiti covered the system and it seemed the city was going the way of 'A Clockwork Orange,' " said Gene Russianoff, attorney for the commuter advocacy group Straphangers Campaign, referring to Stanley Kubrick's 1971 ultra-violent film. "But it's symbolic that when the graffiti moved off the trains, we moved into the greatest peacetime economy in the nation's history."

A new round of upgrading is underway -- "going from a lumbering, lethargic subway system to a real streamlined system," according to NYC Transit President Lawrence G. Reuter. A new train control system, similar to ones in London and Paris, is being tested on one Manhattan-to-Brooklyn line; and in the system's largest undertaking, a $16 billion line will be dug, following Second Avenue in Manhattan as a way of relieving congestion. Completion is scheduled for 2011.

The improvements to tracks and trains have helped the system maintain its relatively good safety record. There have been occasional derailments -- one during a strike in 1918 killed 97 and injured 200, and another, in 1991, which was blamed on a drunken motorman who would be convicted of manslaughter, killed five. In 2003, there were 2.65 injuries per 1 million customers, according to the MTA's annual report. During the same 12 months, subway cars traveled more than 347 million miles.

For some, the subway has a reputation for a different kind of danger -- characterized by tabloid headlines about commuters pushed in front of trains by deranged vagrants, and other types of crime. Today the subways average about nine major felonies a day, the lowest in decades, according to police statistics.

Still, if some fear the underground world, others revel in it.

There are the subway drivers, of course. "Nobody gets to see how hard we work," said operator Andrew Lockhart, 55, waving at afternoon passengers, some of whom he has gotten to know by sight.

There are people who make a more informal living in the tunnels. Edrits Diaz-Colon, 52, who is blind, lives in city shelters and panhandles in subway stations, collecting $60 on an average day.

"A guy once gave me $250," he said.

There are musicians -- one-man bands, blues harmonica players and, if the commuters rushing past get lucky, performers such as cellist Cynthia Mulat, 22, who was playing Mozart on a recent day on the Rockefeller Center station platform with her sister, Angie Kifu, 24, and their cousin, Shirley Mawejje, 20, both violinists. Former New York residents now living in Georgia, they return from time to time to play in the subways as they used to do.

"People really enjoy us," Mulat said, "and it keeps us going to see people going about their day."

Every day, millions swipe their MetroCards -- successor to the old subway tokens -- and pour through the turnstiles, rushing uptown or downtown.

It is "hard to imagine not being able to go underground and get where you're going very quickly," said Thomas Mellins, one of the curators of the Museum of the City of New York exhibit.

In fact, he said, "It really is hard to imagine New York without its subway system."

"Nobody gets to see how hard we work," said driver Andrew Lockhart, 55. He said he gets to know regular passengers and often waves to them.Conductor Daniel Wrynn was aboard a "redbird" car on its final journey on Nov. 3, 2003. Redbird cars were a mainstay of the subway for 40 years.This May 1902 photo shows how the pavement of 42nd Street was dug up between Madison and Vanderbilt Avenue.With the city skyline behind it, the A train tracks across Jamaica Bay en route to the Far Rockaways in Queens. Jamie L. Andujar, center, was a rider on the last of the redbird cars on its final journey from the Times Square station to the Willets Point station in Queens.