The Swiss government will hand over details of about 4,450 bank accounts to U.S. authorities as part of a deal struck with Washington over UBS, it said on Wednesday.

The agreement brings to an end a row which has strained relations between the United States and Switzerland and challenged the latter's jealously guarded bank secrecy laws.

It could help UBS, the world's second-largest wealth manager, restore an image that has been battered by the financial crisis and the U.S. dispute, and may open the way for the Swiss government to sell its stake in UBS.

UBS shares were down 3 percent at 1352 GMT.

In the UBS case, the United States will submit a new treaty request to Switzerland and will withdraw the John Doe summons that demands disclosure of the identity of 52,000 UBS accounts holders, the Swiss government said.

In return, Switzerland has undertaken to process a new treaty request, concerning approximately 4,450 accounts, within a year.

The U.S. tax commissioner said the deal would give Washington access to more than 5,000 Swiss accounts.

The client accounts to be disclosed will likely belong to people suspected of committing tax fraud under the terms of a double taxation agreement that obliges Switzerland to provide help if Washington seeks it in a criminal investigation.

The Swiss government statement made no mention of any possible fine for UBS.

(Writing by Sam Cage; Editing by Erica Billingham)