MOSCOW, OCT. 17 -- The president of the Ukraine announced today that he would replace his prime minister in an attempt to halt a growing campaign of civil disobedience in the Soviet Union's second most populous republic.

The announcement that Prime Minister Vitaly Masol, a holdover from the hard-line regime of former Ukrainian Communist Party chief Vladimir Shcherbitsky, is prepared to step down is believed to be the first time such a senior Soviet official has made such an offer in direct response to public protests.

But it failed to satisfy student protesters who have organized hunger strikes in the Ukrainian capital, Kiev, and other towns and cities across the republic. They said they would press ahead with their campaign for new multi-party elections, the creation of a Ukrainian army and the nationalization of Communist Party assets.

The unexpected concession by Ukrainian President Leonid Kravchuk focused attention on the unstable political situation in a region once renowned for its conservatism. Ukrainian nationalism, which was confined to the republic's western, Catholic regions for the past few years, now appears to be spreading to other areas.

With a population of more than 50 million, the Ukraine is a vital part of the Soviet Union's Slavic heartland, much more important than the Baltic states or the Transcaucasus. It serves the country both as a breadbasket and an industrial base, accounting for one-quarter of total production of food and coal and more than one-third of steel.

Over the past two weeks, the area in front of the republic's parliament in Kiev has come to resemble Beijing's Tiananmen Square during last year's student protests. Dozens of tents have been pitched on the marble courtyard to house more than 200 fasting students and their supporters.

According to news agency reports from Kiev, more than 100,000 protesters have taken part in street demonstrations, university sit-ins and other protests over the past week. Strike committees have been formed in several large factories in support of the students.

"Masol's resignation won't be enough to satisfy us. It's just a bone that the authorities have tossed out in an attempt to calm the situation," said Mikhail Ratusnie, the coordinator of a republic-wide strike committee in support of the students.

The republic's legislature, elected last spring, has a majority of 239 Communists opposed by a Democratic Bloc of 114 nationalist deputies. The Communists have resorted to stealing chunks of the opposition's platform to retain a minimum of political authority.

In July, the legislature approved a radical sovereignty declaration, calling for the establishment of a separate army and currency. The protesters maintain that the Ukrainian government has done little to implement the declaration, which went further than those adopted by many other Soviet republics.

Today, news services reported from Kiev that the legislature voted to adopt a new constitution to support the declaration of sovereignty. It also agreed to draft a law requiring conscripts to perform their military service on Ukrainian territory. In another move to satisfy the protesters, legislators agreed to hold a referendum next year as a vote of confidence on their performance.