PORTLAND, Ore. (AP) _ The sun burned through the clouds over northwestern Oregon today for the first time in five days, but floodwaters fed the mighty Columbia River as it swelled to the brim.

Oregon's largest city dodged the worst of the disastrous flooding sweeping the Northwest. The Willamette River, which authorities had feared would surge 2 1/2 feet over a sea wall in downtown Portland, crested about 3 inches below the top of the wall late this morning.

But the danger hadn't lifted, just shifted.

Since Wednesday, record rains and melting snow have swamped hundreds of highways, released dozens of mudslides and forced at least 20,000 people to flee their homes in Oregon, Washington, Idaho and Montana. As many as 1,000 people were hastily evacuated this morning in northern Idaho after a dike ruptured.

Three people died and two were missing in Oregon, hardest hit by the flooding. At least one person died in Washington.

President Clinton today declared disasters in Oregon and Washington counties hit by the flooding, providing federal assistance to flood victims.

A mountain slope on the Oregon side of the majestic Columbia River Gorge gave way Wednesday night, burying Interstate 84 and train tracks axle-deep in mud and rocks. Nine freight trains were stranded in the 70-mile stretch east of Portland, and officials expected the city's chief east-west transportation corridor to remain blocked through the weekend.

In Oregon City, floodwaters knocked the wooden Chamber of Commerce building on its side.

About 12,000 people were kept from their homes a second day in the Salem suburb of Keizer because sewer system pumps failed and could cause raw sewage to back up into homes. Even so, Mayor Dennis Koho considered the city lucky.

``We had a 100-year flood and we came out pretty much unscathed,'' Koho said.

Nancy Baldwin was among the 250 people who spent the night in gymnasium of Whiteaker Middle School in Keizer. Officials said Keizer residents might be able to return by early afternoon, and Baldwin couldn't wait.

``We have seven cats waiting for us at home in our attic,'' she said.

Northwesterners, more prone to rusting than tanning, are no strangers to wet winters. But to say it's raining here is like noting Minnesota has been chilly lately. Portland, which averages 36 inches of annual rainfall, was already sodden with more than 12 inches for the year as of Thursday.

And more rain fell overnight, though the clouds began parting across northwestern Oregon this morning _ the first break from the rain since Sunday.

In the nation's winter of extremes, the Northwest flood is just the latest case. For three days, Oregon's Willamette River valley has been the center of attention, its placid flow swollen to a boiling channel that's uprooted trees and muddied homes in riverfront neighborhoods of the state's major cities.

In Portland, at the confluence of the Willamette and Columbia rivers, the threat of flooding eased significantly today. The Willamette was about a foot below the top of the sea wall downtown this morning. It lapped over the wall in at least one low spot, but caused no damage.

Scott Mather, a carpenter with the city, said he was sure the wall would stand up.

``I was a little worried in the beginning but yesterday afternoon a lot of volunteers showed up and it came together,'' he said. ``It was incredible to see and be here.''

Authorities took some pressure off the Willamette at the city's northern edge by decreasing the flow from the Bonneville Dam upstream on the Columbia. But a rising reservoir will force them to increase the flow later today.

Forecasters predicted major flooding along the Columbia from Portland to its mouth at Astoria, 75 miles west.

``The disaster potential in the city today is the Columbia River, not the Willamette,'' said George Houston, Portland's emergency management coordinator.

Along Portland's northern edge and across the Columbia in Vancouver, Wash., residents fled low-lying neighborhoods as the river rose Thursday. Three large riverside hotels closed. Caramel-colored floodwaters lapped at the decks of waterfront condominiums.

About 200 homes and and several businesses flooded overnight in the Oak Grove and Gladstone areas along the Willamette in suburban south Portland, said Dave Phillips, Clackamas County roads manager.

A mudslide in Portland's posh West Hills, a residential area of steep, twisting streets, knocked a seven-unit condominium off its foundations, but no one was seriously hurt.

The Oregon Air National Guard moved 18 F-15 fighter jets, five helicopters and three cargo planes from Portland International Airport, flying some to Washington state and towing others to higher ground at a nearby golf course.

``Each jet is worth $30 million, so we're not taking any chances,'' guard spokeswoman Mona Spenst Jordan said.

Neither were city officials and volunteers in downtown Portland.

``Water's going everywhere,'' Trase Myers said Thursday as he and others hurried to stack 40-pound sandbags against a building. ``I can't believe the destruction the water has caused.''

The mood in the downtown brightened a bit today.

At the RiverPlace Esplanade, where 8 inches of water lapped against sandbagged shop doors, many onlookers were out taking pictures.

``A lot of people are in a good mood down here. They're glad to see the sun,'' Fire Bureau spokesman Neil Heesacker said.

The missing included a 62-year-old woman who was in a house swept into a tributary of the Columbia near Portland and a woman whose car plunged into river runoff near Salem.

The three Oregon dead were a 8-year-old girl who fell into a culvert; an 84-year-old woman whose car was hit by a van and pushed into the Luckiamute River near Corvallis; and a 46-year-old man who drove into high water, then fell into a ditch as he and his girlfriend tried to wade back to dry ground.

The body of the man, Doug Edward Andrews of Brownsville, was found in a flooded field near Interstate 5. His girlfriend spent the night clinging to a tree, said Linn County Sheriff Dave Burright.

In Washington state, extensive flooding occurred along eight rivers, and mudslides closed nearly three dozen highways. A home was destroyed by a mudslide in Washington's Kitsap County, and a freight train was swept off its tracks along Puget Sound near Tacoma.

Near Kent, Wash., a 60-year-old man was killed when his car fell into a huge hole caused by a washed-out culvert, police said today. The driver of a second car was rescued by a passerby.

Amid the deluge were water shortages. As muddy floodwaters contaminated water sources, Portland and Salem officials urged people to conserve water. Smaller towns closed water their plants and told residents to buy bottled water.

As swollen streams converged in the Willamette River valley, evergreen trees were yanked out by their roots, bobbing and lunging downstream like huge battering rams.

Watching debris in the rivers became a spectator sport.

In Gladstone, a Portland suburb, hundreds of people lined a sidewalk today to watch logs and garbage and the occasional drift boat sweep past in the Willamette.

A nearby McDonald's was an island and sump pumps were steadily removing water from the nearby bowling alley.

``This is a terrible mess. It's the worst I've seen in 25 years,'' said longtime resident Mike Temple. ``I'm afraid to think about what this is going to cost when it's over. It's going to be awesome. It's lucky more people weren't killed.''