Wal-Mart to New York: fuhgeddaboudit.

Frustrated by a bruising, and so far unsuccessful battle to open its first discount store in the nation’s largest city, Wal-Mart’s chief executive said yesterday, “I don’t care if we are ever here.”

H. Lee Scott Jr., the chief executive of the nation’s largest retailer, said that trying to conduct business in New York was so expensive — and exasperating — that “I don’t think it’s worth the effort.”

Mr. Scott’s remarks, delivered at a meeting with editors and reporters of The New York Times, amounted to a surprising admission of defeat, given the company’s vigorous efforts to crack into urban markets and expand beyond its suburban base in much of the country. In recent years, Wal-Mart has encountered stout resistance to its plans to enter America’s bigger cities, which stand as its last domestic frontier.

Much of the opposition to Wal-Mart in cities like New York is led by unions. Organized labor, fearing that the retailer’s low prices and modest wages will undercut unionized stores, have built anti-Wal-Mart alliances with Democratic members of city councils.