Mayor Marion Barry worked tirelessly Tuesday to prevent the D.C. City Council from overriding his veto of interstate banking legislation, but in the end his efforts were thwarted by apartheid in South Africa -- a seemingly remote issue that edged its way into the banking debate at a crucial moment.

Barry vetoed the legislation in hopes of obtaining an alternative banking measure that would have sped the arrival in the District of the nation's largest banks, particularly Citicorp of New York. But council members, including some of the mayor's staunchest allies, were influenced by Citicorp's major investments in South Africa, and ended up voting to override Barry's veto.

At a press conference yesterday, Barry characterized the override vote as a "win-win for everybody," adding that his veto had been a "strategic" move "to raise the level of consciousness of the community about banking" and to force local banks that backed the legislation to pledge to make more loan money available in the city's most depressed areas.

But Barry hardly played the part of a cool-headed strategist Tuesday night, as he prowled the halls in search of a fifth vote to sustain his veto. He circulated a letter to council members urging them not to let Citicorp's South African ties influence their votes and reminding them that "our relatives have been and continue to be rejected by the local banks when we applied for a home mortgage or personal loan."

Barry contends that six council members had urged him to veto the bill as a means of pressuring local banks to make more concessions to the city, but that support for the veto began to dissipate after American Security Bank began pledging to make investments in Southeast Washington.

The mayor's hopes hinged on City Council member Hilda Mason (Statehood-At Large), his longtime ally, delivering the fifth vote to sustain the veto. Yet Mason already had decided to oppose the veto, after conferring with an aide to Randall Robinson, the executive director of Transafrica and a key organizer of the protests outside the South African Embassy.

Mason sent a memorandum to her council colleagues before the vote saying that Robinson "would not want Citicorp doing business as a bank in the District with its present record in South Africa."

Mason became concerned about the issue after a lobbyist for the D.C. Bankers Association circulated a newspaper article indicating that Citicorp had no plans for divesting itself of investments in South Africa.

She said in an interview yesterday that she also was not impressed with Citicorp's efforts to spur redevelopment of distressed areas in other major cities. Citicorp has promised to invest $100 million in the District in return for a banking license.

At his press conference, Barry said that too much has been made of Citicorp's investment's in South Africa.

"All the money-center banks had the same problem with South Africa," Barry said. "They were there long before this movement came and divestiture was proposed . . . . They have their portfolio they are trying to sell off. Also it's interesting the number of local banks that use Citicorp as their investment bankers, so it cuts both ways."

The legislation approved by the council will allow banks in the District and 11 southeastern states to merge or acquire each other. It is a limited interstate arrangement that local bankers strongly favor because it protects them from immediate competition from the nation's largest banks, which are known as money centers.

Although Barry initially proposed the legislation, he later sought amendments to allow the nation's largest banks to enter the District within two years, or earlier if they made large investments in distressed areas. When the council refused to go along with the amendments, the mayor vetoed the bill.

Before the council voted 9 to 3 to override the veto, council member Charlene Drew Jarvis (D-Ward 4) promised that her Housing and Community Development Committee would devise new legislation within 30 days that would address the national banking issues raised by Barry.

When Barry realized that he couldn't win, he asked one of his supporters to vote for the override but to make a public statement to put pressure on Jarvis to address the national banking issue at some later date, according to a source.

Council member Wilhelmina J. Rolark (D-Ward 8) announced at the meeting that while she had come to support the veto, she changed her mind in light of Jarvis' promise to send the full council a new banking bill within 30 days.

Yesterday, Rolark denied any knowledge of an attempt by Barry to shift a vote.

While Barry claimed victory yesterday, two council members who voted to sustain his veto had mixed views about the override.

"We lost the battle but we will win the war," said Frank Smith (D-Ward 1). "I told people they would be irresponsible to override the veto if they had not locked votes in place to put some kind of trigger in and allow some consideration of an early entry provision" for banks outside the region.

But council member John Ray (D-At Large) said the mayor's efforts to use the veto as leverage to get commitments from local bankers for District economic development projects had failed.

"Today the bankers are all sitting back in their chairs, smoking their cigars and laughing because they snowed the City Council," said Ray. "They got away clean. Dirt clean."

Had the mayor's veto been sustained, Ray said, the council could have pushed for a new bill that would require any bank seeking to acquire a District bank to make investment commitments to the ecnomically disadvantaged District neighborhoods.

Lucius P. Gregg, a Citicorp vice president and lobbyist on the banking issue, said yesterday that he would resume discussion with city officials this week. He said that while Citicorp "must do the right thing on South Africa" he called the issue a "smoke screen used by local banks to divert the attention away from the needs of the community."

Gregg said Citicorp will be looking for "some kind of limited banking function" in the District as it seeks to invest money in the undeserved areas of the city.