The Miami Heat basketball team has agreed to cover the entire $165 million cost of building a new arena here under an agreement with Dade County officials, in response to widespread opposition to the use of public money for the construction.

Under a deal announced on Friday, taxpayers would still pay $6.5 million a year to operate the new arena. The county would also seek a sponsor to pay for the right to put a name on the sports arena; the county would guarantee the team $2 million annually for such naming rights. Dade County officials said the costs would be offset by the opportunity to profit from the naming rights and to share in the arena's profits from parking and adjacent retail development.

''We expect the county not only to come out even -- we expect it to make money,'' said Raul Masvidal, a local entrepreneur who represented the Mayor of Dade County, Alex Penelas, in the negotiations with the owner of the Miami Heat, Micky Arison.

With Friday's announcement, supporters of the arena hoped to avert a defeat at the polls on Tuesday. The financing agreement renders moot the part of a referendum that asked voters to decide on spending public money to build the new arena, but they will be asked to decide whether the arena should be built on the waterfront. The new arena would replace an arena that is only eight years old; the public is still paying for that arena.