U.S. stocks declined for the week, with benchmark indexes erasing gains in the final session, as disappointing results from Amazon.com Inc. triggered a selloff in technology shares and tensions over Ukraine climbed.

Amazon.com dropped 6.5 percent after predicting an operating loss in the current quarter, contributing to a 0.5 percent slide in the Nasdaq Composite Index.

Phone stocks sank on concerns that price competition will hurt profits. Apple jumped 9 percent for its best week since August as the company sold more iPhones than forecast. Allergan Inc. surged 26 percent after Valeant Pharmaceuticals International Inc. offered to merge with the maker of the Botox wrinkle treatment.

The Standard & Poor’s 500 Index slipped 0.1 percent to 1863.40 in the week, following its best rally since July. The Dow Jones Industrial Average fell 47.08 points, or 0.3 percent, to 16,361.46. The Russell 2000 Index of small companies sank 1.3 percent.

“There’s uncertainty in the market right now over whether valuations are realistic in a lot of the technology companies,” Walter “Bucky” Hellwig, who helps manage $17 billion at BB&T Wealth Management, said in a phone interview.

Geopolitical tensions contributed to the final-day selloff, after U.S. Secretary of State John Kerry warned Russian President Vladimir Putin that he is running out of time to ease tension in Ukraine.

The Treasury will sell $25 billion in three-month bills and $23 billion in six-month bills on April 28. They yielded 0.025 percent and 0.050 percent, respectively, in when-issued trading.

— Bloomberg News