Cuba has unexpectedly offered to release between 500 and 1,000 political prisoners and allow them to come to the United States, U.S. officials said yesterday.

Although State Department officials applauded the offer as "a welcome step," they said they did not know what had prompted the Cuban nation or whether it represents a gesture toward improving badly frayed U.S.-Cuban relations.

The officials said President Fidel Castro's government made the offer two weeks ago in what one called "an unexpected, unilateral decision by the Cubans."

"We didn't initiate it, and we didn't negotiate for it," the official added. "The Cubans contacted us and asked if we would be willing to take a number of detainees that could range from 500 to 1,000 people."

At the Justice Department, a spokesman, Terry Adamson, announced that applications are being screened for admission of the first 48, plus 30 members of their families. Under U.S. immigration law, Attorney General Griffin B. Bell has authority to admit immigrants in emergency situations or if he determines "it is in the interests of the United States."

President Carter initially made normalization of relations with Havana a major goal of his foreign policy. That process seemed to take a big leap forward a year ago when the two governments, after 17 years of isolation from each other, opened interests sections to give each other diplomatic representation in Washington and Havana.

In more recent months, the improving atmosphere has been chilled by Washington's concern over Cuban military involvement in Africa. In May, relations between the two countries plummeted to the level of acrimonious name calling after Carter publicly accused Cuba of aiding the bloody rebel invasion of Zaire's Shaba Province from neighboring Angola.

Even before the Shaba incident, Washington had said that further normalization depended on resolution of three problems: reduction of the Cuban presence in Africa, settlement of U.S. claims for $1.8 billion against the Castro government and improvement of the human rights situation in Cuba.

Diplomatic sources say they see no likelihood in the near future of Havana giving ground over the claims issue or its activities in Africa. But, the sources add, human rights is an area where Castro has some room for maneuver, and some speculated yesterday that the prisoner-release offer might represent a conciliatory bid to take some of the acrimony out of his dealing with Washington.

State and Justice officials said the names of those who might be admitted were being withheld temporarily to assure their privacy. They did day, though, that all of those whom Havana proposes to let go are Cuban nationals who were convicted of political offenses and do not include any of the handful of U.S. citizens still held in Cuban prisons.

Adamson said some of the Cubans currently are in prison, and some have been released either on parole or because they have served their sentences. He said some may have been involved in the abortive, U.S.-backed 1961 Bay of Pigs invasion by anti-Castro exiles, but added he did not know whether any were "well known or not."

Adamson also said the screening process will involve to Havana by representatives of State, the FBI and the Immigration and Naturalization Service to make certain that the initial 48 applicants do not include any "spies, terrorists or common criminals."

He stressed that all the applicants will be treated on a case-by-case basis and said there was no guarantee of how many will eventually be admitted. However, Department sources said all the potential entrants will be given a careful and sympathetic hearing.