After a weekend of brinksmanship, Amazon.com on Sunday surrendered to a publisher and agreed to raise prices on some electronic books.

Amazon shocked the publishing world late last week by removing direct access to the Kindle editions as well as printed books from Macmillan, one of the country’s six largest publishers, which had said it planned to begin setting higher consumer prices for e-books. Until now, Amazon has set e-book prices itself, with $9.99 as the default for new releases and best sellers.

But in a statement Sunday afternoon, Amazon said it would accept Macmillan’s decision.

On Friday, Amazon removed “buy” buttons from thousands of titles published by Macmillan, including recent best sellers like “Wolf Hall” by Hilary Mantel and “The Gathering Storm,” by Robert Jordan and Brandon Sanderson. Customers who wanted to buy print editions could do so only from third-party sellers. Digital editions made for Amazon’s Kindle device disappeared.

In a strongly worded message on its Web site on Sunday, Amazon said that while it disagreed with Macmillan’s stance, it would bow to the publisher’s plan.