TOKYO (AP) _ Prime Minister Yasuhiro Nakasone, who recently apologized to Americans for racial remarks, offered a formal apology to Japan's aboriginal Ainu people upset over his description of Japan as an ethnically homogenous society, an Ainu spokesman said today.

Nakasone apologized in a letter for his comments, said Takao Yokoyama, a member of the Kanto Utari, a Tokyo-based Ainu organization. But he said the prime minister blamed the press for any hard feelings.

Kanto Utari had twice demanded in letters to Nakasone that the premier explain ''the basis (for his contention) that Japan is a monoracial society,'' Yokoyama said in a telephone interview with The Associated Press.

Kanto Utari is made up of individuals who are all or part Ainu, the people who inhabited the Japanese islands before ancestors of modern-day mainstream Japanese came over from the Asian continent about 3,500 years ago.

Anthropologists believe the Ainu may be descendants of a Caucasoid people who once lived in northern Asia. Their physical appearance - the men have fairly heavy beards, for example - sets them apart from mainstream Japanese and other Oriental populations. Ainu religion is animist and centers on a bear cult.

Nakasone wrote to Kanto Utari on Saturday saying, ''I deeply apologize for causing trouble to you because of distorted newspaper reports'' about his remarks, Yokoyama said.

Nakasone told a gathering of his governing Liberal Democratic Party on Sept. 22 that Japan has a higher literacy level than the United States because Japan is a ''homogenous society'' and America has ''a considerable number of blacks, Puerto Ricans and Mexicans.''

Nakasone's remarks drew a sharp criticism from members of the U.S. Congress and minority groups in the United States, who charged that the Japanese leader's words were discriminatory.

On Sept. 26, Nakasone issued a formal apology to all Americans, and during a session of the Diet, or Japanese parliament, last month he also apologized to the Japanese people for his remarks.

Nakasone's reply was ''not an answer to our question,'' Yokoyama said. ''He shifted his responsibility to the news media.'' The group, which was formed in 1980 and is made up of 50 households with at least one member who is Ainu, will send another written inquiry to Nakasone, he said.

Hiroshi Ibata, an acting director of the Hokkaido Utari Association, an Ainu organization on Japan's northernmost island of Hokkaido, said Japanese newspapers all reported Nakasone's ''homogenous'' comment the same way and that the premier's remarks were not distorted.

Ibata said there currently are about 24,000 Ainu living in Hokkaido. He did not know the number of Ainu living in other parts of Japan because there are no nationwide statistics on the subject.

''It is a fact that the Ainu have an independent language and culture,'' Nakasone said in televised remarks to a Lower House budget committee session today.

But he added, ''From an objective standpoint, it is a fact that the Japanese are more homogenous than other people.''