LOS ANGELES — Spirit has always been the unluckier of NASA's twin Mars rovers.

Just weeks after landing in a Martian crater in 2004, it went haywire and transmitted gibberish to Earth. Engineers eventually nursed it back to health.

As if the near-death experience wasn't enough, Spirit was upstaged early on by its twin Opportunity, which landed in a geologic gold mine and was the first to determine that the frigid, dusty planet possessed a wetter past.

Bad luck has fallen again on Spirit. As the workhorse rover marks its sixth year on the red planet on Sunday, it finds itself stuck in a sand trap, perhaps forever. The six-wheel robot geologist has been in jams before, but this is the worst predicament yet.

With Martian winter arriving in several months, Spirit may not have enough power to keep going unless scientists can point the solar-powered rover toward the sun.

Spirit "has always been our drama queen," chief scientist Steve Squyres of Cornell University said.

The latest misfortune occurred in April when Spirit, driving backward because of a lame wheel, broke through the crusty ground like a person falling through a frozen pond and became bogged in fluffy sand. Little progress has been made to free Spirit since.

NASA was dealt a major setback recently when another wheel appeared to have stopped moving, leaving Spirit with only four working wheels to plot its great escape.

"With only four driving wheels, it doesn't look good," project manager John Callas of NASA's Jet Propulsion Laboratory said.

It's been a particularly rough year for Spirit. Besides getting stuck in a sand rut, it suffered sporadic bouts of amnesia and other woes including sudden computer reboots.

Though the prognosis of getting Spirit out looks bleak, scientists are not ready to give up yet. But if they exhaust all escape options, they will switch to Plan B and try to tilt the rover to the north where it can get more sunshine to keep running so that it can continue to do science in one spot.

"If we can't get the rover unstuck, it will become a Mars lander," Callas said.

Unlike a rover, which performs science experiments as it roams, a lander studies its surroundings while stationary.

Fortunately for researchers, what may turn out to be Spirit's final resting spot looks like a scientific bonanza. The sand is rich in sulfate, a mineral that forms in the presence of water, researchers say.

Originally designed as a three-month mission, Spirit and Opportunity have operated past their warranty. Since Spirit landed on Jan. 3, 2004, followed by Opportunity three weeks later, the rovers have driven a total of more than 16 miles, cresting hills and peering into craters.

Spirit and Opportunity are also closing in on the record for longest-running Mars surface mission currently held by the Viking 1 lander, which operated on the planet for six years and 116 days.

From the start, Spirit has had hard luck. Squyres, the mission's chief scientist, attributes part of that to geography.

Opportunity didn't have to work hard to impress scientists because it parachuted to an ancient lakebed awash with minerals that pointed to geologic evidence of past water. Spirit, on the other hand, touched down in the rugged lava plains of a crater on the opposite side of the planet and had to trek toward the hills to make discoveries.

"In order to get the science, we simply had to push Spirit harder," Squyres said.

There's one feat that Spirit achieved on its own. In 2005, it became the first robotic craft to scale an extraterrestrial hill as tall as the Statue of Liberty.

With Spirit immobile, it's still snapping pictures of its surroundings and sending data back to Earth. Spirit's next challenge will be surviving the upcoming Martian winter. Meanwhile, Opportunity has been busy grinding into a dark-toned rock that scientists think may be a stony meteorite.

On the Net:

Mars rovers site: marsrovers.jpl.nasa.gov/home