NEW YORK (AP) — Shares of credit card processors Visa Inc. and MasterCard Inc. edged higher Thursday after a UBS analyst upgraded both stocks to "Neutral."

Analyst John Williams said investors have been willing to pay more for both stocks because of Visa and MasterCard's earnings growth and long-term business visibility. Williams had downgraded shares of both companies to "Sell" in July, saying he thought the shares would be hurt by slower global spending growth.

The analyst said Thursday that the downgrade "was simply wrong." He raised his price target on shares of MasterCard to $519 from $425 and lifted his target on Visa shares to $156 from $123.

In afternoon trading, shares of MasterCard picked up $6.80 to $519.71 and Visa shares rose $2.51 to $157.93. Since Williams' downgrade in July, MasterCard shares have gained 19 percent and Visa shares are up 26 percent.