Rep. Harold Washington (D-Ill.), bidding to become this city's first black mayor, desperately clung to an eroding lead today in a bitter and ugly campaign that has split voters along clear racial lines.

With two days remaining before Tuesday's general election, Washington and his Republican opponent, lawyer Bernard E. Epton, have become symbols in an all-out political war.

Washington's backers see him as a crusader who finally will deliver power to 1.2 million blacks who have been loyal Democratic foot soldiers for half a century and fervently believe that he should be elected, just like every other Democratic nominee for mayor has been in the past 52 years.

Polls made public this week showed Washington with 51 percent, Epton 38 percent and 11 percent undecided. In the last few days both camps have said that the undecided vote appears to be breaking toward Epton.

Washington, 60, was introduced today by the Rev. B. Herbert Martin at a prayer breakfast this morning as "our John the Baptist, crying 'The kingdom is at hand.' "

Epton, 61, is the would-be savior of the 1.3 million whites, most of them loyal Democrats, who are fearful of losing the power they have so long enjoyed and of having their segregated neighborhoods invaded.

Caught in the middle are a Hispanic community of more than 422,000, itself divided and likely to split the meager 65,000 votes it is expected to cast, and a handful of wealthy white liberals in the high rises along Lake Michigan, who are likely to be the crucial swing element.

Also in the middle is the city--a manufacturing, retail trade, distribution and construction center that is the hub of the Midwest and the national Democratic Party, which is worried about black reaction nationally.

There once was a time when this city's politics were well controlled, when the sometimes autonomous political fiefdoms of all 50 wards were kept in line by powerful and politically shrewd mayors like Edward J. Kelly and Richard J. Daley.

On Tuesday, more than 1.3 million voters in this city of 2.5 million people are expected to take sides in the latest battle, which will not end the war but could set the terms of future skirmishes.

Polls have shown voters falling along racial lines, with whites supporting Epton's drive to become the first Republican mayor in 52 years and blacks solidly behind Washington.

Washington, beset in the closing days of the campaign by a series of charges that he had left a trail of unpaid income, property and auto taxes and utility and clothing bills, was struggling today to get off the defensive and stem a loss of support.

"I've made mistakes," he told 1,200 ministers and laymen at the prayer breakfast, "and I have paid an inordinate price. But I have never in my public life benefited by one solitary dime or quarter."

By contrast, Washington charged, Epton was guilty of "manifest conflict of interest" during the years he served on the state legislature's insurance committee while his "law firm got richer, richer, richer" from insurance industry clients.

"How dare he sully my character!" Washington cried, and, in a play on his opponent's slogan, added, "Come clean, Bernie, before it's too late."

But Epton, staying on the high road his managers have ordered ever since the undecided white votes started breaking his way, refused to be drawn into personal debate as he worked his way through the city.

Today Epton pulled out of a joint appearance with Washington Sunday on the NBC "Meet the Press" program, charging that one of the panelists, Vernon Jarrett, a black columnist for the Chicago Tribune, was a "biased reporter."

Chicago is a city of neighborhoods, mostly ethnic, scattered in checkerboard fashion over 277 square miles, separated by railroads, expressways and industrial and commercial belts. Blacks generally live on the South and West sides; whites on the North, northwest and southwest sides.

No other major American city is so racially segregated. Few retain such ethnic diversity: 10 percent of the population is of German ancestry, 10 percent Polish, 9 percent Irish, 5 percent Italian, with smaller enclaves of first- and second-generation Greeks, Latvians, Estonians and Swedes clinging to their heritages.

But the city has undergone a dramatic population shift. Between 1950 and 1970, it lost more than a quarter of a million people, and the number of whites of foreign stock dropped 628,186. The black population, meanwhile, grew.

Whites, relying on the Democratic machine for protection, have retained political power--22 percent of the City Council since 1955 has been Irish, as has every mayor since 1933, except Bilandic. Many of the city government's powerful department heads are Irish.

Though blacks now make up 40 percent of the population and a majority of the registered voters in 19 of 50 wards, only 16 of the 50 City Council members are black.

For Chicago's blacks, Washington symbolizes the quest for long-denied political power.

For whites, Epton symbolizes resistance. "The white ethnics perceive a gradual dilution of their political power," said Louis H. Massotti, a Northwestern University political scientist and urban affairs expert.

Though whites are still a majority of the city's voting-age population, blacks and Hispanics are the potential controlling coalition of the future. Even a loss by Washington on Tuesday might only postpone the inevitable.