Jackson Browne released Running on Empty in 1977
Singer Jackson Browne has received an apology from former presidential candidate John McCain for using one of his songs during last year's campaign.
Browne sued McCain and the Republican Party for copyright infringement last August, after his song Running on Empty was used in an internet advert.
Details of an agreed financial settlement were not disclosed.
The Republican Party also said it would get artists' permission before using their work in future campaigns.
Browne said: "This settlement is really a great affirmation of what I believed my rights to be, and all writers' rights to be.
"One would hope that a presidential candidate would not only know the law but respect it. It was a matter of bringing that issue to bear."
Running on Empty was used in an advert mocking Democrat Barack Obama "for suggesting that the country conserve gas through proper tyre inflation".
A statement from the party said McCain did not know about the advert, which was created by the Ohio Republican Party and removed after Browne complained.
"We apologise that a portion of the Jackson Browne song Running on Empty was used without permission," said a statement attributed to McCain and the state and national parties.
Legal papers filed by Browne last year stated the singer was concerned the use of his music would cause people to conclude he was endorsing McCain, even though the 60-year-old singer is a self-described liberal.
He had been seeking $75,000 (£45,600) in damages.
Browne released the song Running on Empty - and an album by the same name - in 1977.
McCain's campaign received complaints from several musicians whose music was used during his presidential candidacy, including Foo Fighters, Heart and John Mellencamp.