The Discovery space drama ended today as abruptly as it began when the shuttle astronauts used the craft's huge mechanical arm to dislodge a small but hazardous block of ice from the spaceliner's fuselage that could have endangered Wednesday's return to earth.

With help from astronaut Sally K. Ride on the ground and a television camera on the robot arm's wrist, Discovery commander Henry W. Hartsfield Jr. and astronaut Judith A. Resnik delicately maneuvered the 50-foot-long mechanism and bumped away a block of ice that had grown to at least 20 inches in length and weighed as much as 25 pounds, covering two vent nozzles.

Flight directors had feared that it would rip loose as the shuttle began its return, strike the craft's tail and tear loose some of the tiles that protect the tail from the searing heat of reentry.

"I'm happy to report that the majority of our ice ball has departed and is in orbit 160 miles above the earth and behind us," said flight director Randy Stone from Mission Control in Houston.

With that welcome news, Stone reported that there was no longer any need for astronauts Steven A. Hawley and Richard M. Mullane to prepare for an unscheduled spacewalk to try to loosen any remaining ice. Discovery is due to touch down on the seven-mile-long runway at this Air Force base in the Mojave Desert at 9:38 a.m. EDT, with national television coverage.

Hours before the shuttle was to return to Earth, an oxygen leak was discovered and the crew was awakened early to work on the problem, which officials said posed no hazard to the mission.

The landing in California is to be controlled entirely by computer -- the first automatic landing in 12 shuttle flights.

Late today Vice President Bush and his wife, Barbara, visited Mission Control and called the astronauts to ask them how the Discovery's maiden mission was going "now that you've got your plumbing fixed."

"It's going pretty well and we now have a new addition to the space fleet," Hartsfield replied.

"When are you going to come home?" Barbara Bush asked Resnik.

Replied Resnik, "Tomorrow, probably." Said Mrs. Bush: "We'll be waiting."

Bush told the crew that he had lunch with President Reagan the other day and that the talk over lunch was largely about space. Said Bush: "He was really fired up, and I imagine he'll be uncontrollable when you get back and have time to see him."

When the crew of Hartsfield, Mullane, Hawley, Resnik, Michael L. Coats and Charles D. Walker awoke this morning, their first task was to deal with the ice block that had built up during the mission.

One mass covered an excess-water vent nozzle. A smaller icicle covered a human-waste nozzle just below it and prevented use of the shuttle's toilet. Why the ice adhered so tightly to the shuttle fuselage is a mystery engineers will have to solve before the next mission, scheduled in October.

"This ice thing was really the last thing on our minds early in the mission when we saw it for the first time," Stone said. "But as it changed shape and kept getting bigger and couldn't be shaken off or melted in the sun, I began to get concerned."

Early this morning, the crew sent bursts of water heated to 300 degrees Fahrenheit through both vent lines in an attempt to blow the ice away.

At the same time, they fired a series of on-board thruster engines to shake the forward part of the spaceliner and give the ice an extra jolt.

"No joy with the RCS [reaction control system]," Resnik said. "We're pressing on."

"We shook the whole system with as many different kinds of jet firings as we could come up with," Stone said. "But when we took the arm outside to look at what happened, yea, verily, the ice was still there."

That was the signal for Hartsfield and Resnik to use the arm's "end deflector" in an effort to bang the ice off the fuselage.

First, the astronauts raised the portside payload bay door so that the arm would have more clearance and the wrist camera more visibility.

Helped from the ground by Ride, the first American woman in space and an expert in operating the arm, Hartsfield and Resnik moved the device in toward the fuselage and banged away the ice with a single blow.

At one point, Ride -- who had duplicated the ice-breaking maneuver in a simulator in Houston -- advised Hartsfield that he probably did not have to worry about hitting the side of the shuttle.

"That's a pretty tough area," she said. "It's the wing that you really want to stay away from."

"The ice is gone and about all that remains right now is that the astronauts can no longer use the toilet," Johnson Space Center spokesman Terry White said. "But it also means they can land on time and on schedule Wednesday."

Flight director Stone said that Discovery would continue its flights around the earth tonight with the two frozen vent nozzles pointed toward the sun to make sure that no more ice forms outside the nozzles on the fuselage.

Stone said he was convinced that that would keep any ice from forming. If ice forms outside the nozzles, he said, the astronauts would be ordered to again use the robot arm technique to knock it loose.