But the judge, Denise L. Cote of Federal District Court in Manhattan, rejected some of the measures sought by the Justice Department, including extensive government oversight over Apple’s App Store.

In a filing this week, Judge Cote issued her final ruling on the penalties to be imposed on Apple after the long-running lawsuit against the technology giant filed by the Justice Department in April 2012.

The government accused Apple, along with five major book publishers, of illegally colluding to raise the price of e-books and of trying to curb Amazon’s influence in the publishing industry as Apple prepared to introduce its iPad in 2010.

All five publishers, Macmillan, HarperCollins, Simon Schuster, Hachette Book Group and Penguin Group USA, have since settled, while saying that they did nothing wrong. Random House, which was not named in the lawsuit, merged with Penguin earlier this year.

But Apple, confident of its innocence and with the financial resources to fight in court, went to trial this summer. It defended itself with testimony from a string of high-ranking Apple executives, including Eddy Cue, the company’s senior vice president for Internet software and services, who led the negotiations with publishers.

In July, Judge Cote ruled against Apple in a nonjury trial, saying there was compelling evidence it had violated antitrust laws by conspiring with the publishers.

In her ruling this week, Judge Cote said that Apple may not enter into any agreement with the five settling publishers that “restricts, limits or impedes Apple’s ability to set, alter or reduce the retail price of any e-book.”

The ruling also said that Apple would be prohibited from discussing with any publisher its contractual negotiations with another publisher.

In addition, Judge Cote ordered that Apple cooperate with an external monitor who will evaluate and report on the company’s training reforms and antitrust compliance.

William J. Baer, the assistant attorney general, said in a statement on Friday that the Justice Department was pleased by the court’s ruling.

“Consumers will continue to benefit from lower e-books prices as a result of the department’s enforcement action to restore competition in this important industry,” he said. “By appointing an external monitor to ensure future compliance with the antitrust laws, the court has helped protect consumers from further misconduct by Apple. The court’s ruling reinforces the victory the department has won for consumers.”

Apple has said that it will appeal Judge Cote’s July ruling.

“Apple did not conspire to fix e-book pricing,” Tom Neumayr, an Apple spokesman, said in an e-mail on Friday. “The iBook-store gave customers more choice and injected much-needed innovation and competition into the market.”

At a hearing in United States District Court in Manhattan last week, Judge Cote said that she wished to “intrude as little as possible” on Apple’s business.

The executive, Eddy Cue, Apple’s lead negotiator with the publishers, said he was determined to close deals that would allow them to sell their e-books on Apple’s iBookstore in time for the introduction of the iPad in early 2010.

“I wanted to be able to get that done in time for that because it was really important to him,” Mr. Cue said, referring to Mr. Jobs. He was testifying in Federal District Court in Manhattan in the civil antitrust trial brought against Apple by the Justice Department.

“I pride myself on being successful, but this had extra meaning to me,” Mr. Cue added.

Those sped-up negotiations attracted the attention of the government, which filed a lawsuit against Apple and five publishers in April 2012. Mr. Jobs, the co-founder of Apple, died of cancer in October 2011.

Mr. Cue, the highest-ranking Apple executive to take the stand so far in a trial that began almost two weeks ago, mounted a vigorous defense of Apple, which is accused of colluding with the publishers to fix e-book prices.

Through a nearly full day of testimony on Thursday, Mr. Cue denied that he had encouraged publishers to impose a new business model on other retailers, including Amazon.com. Shown a slide displaying what the government has repeatedly called a “spider web” of communications among the publishing executives, Mr. Cue said he did not know that the executives, from publishers including the Penguin Group USA and Simon Schuster, were talking to one another during their negotiations with him.

“I struggled and fought with them,” he said. “If they were talking to each other, I believe I would have had a much easier time getting those deals done.”

But he also revealed details of an unusually long and close working relationship between him and Mr. Jobs.

Mr. Cue, Apple’s senior vice president for Internet software and services, said he spoke or e-mailed with Mr. Jobs at nearly every step of the negotiations, once calling him on his way to the airport as he left a round of talks with publishers in New York.

In one e-mail, Mr. Jobs questioned Mr. Cue about the fledgling iBookstore. “Are we going to let anyone self-publish? Does Amazon?” he wrote.

“Yes and yes,” Mr. Cue replied.

After publishers signed agreements with Apple, shocking the publishing industry, Mr. Jobs e-mailed Mr. Cue: “Wow, we have really lit the fuse on a powder keg.”

The focus of the government’s questioning turned to December 2009 and January 2010, when Mr. Cue repeatedly flew to New York, met with publishers and tried to reach deals to make their e-books available in the iBookstore on the soon-to-be-unveiled iPad.

For publishers, the appeal of Apple getting into the e-book market was enormous. Amazon, which had introduced its Kindle e-reader in 2007, commanded a 90 percent share of e-book sales at the time. But the default price for newly released and best-selling books on Amazon.com was $9.99, a paltry sum in the publishers’ eyes and one that undermined the value of the authors’ work and cannibalized hardcover sales.

Apple encouraged publishers to switch to a so-called agency model, in which the publishers set the price of a book and the retailer takes a commission. Previously, e-books had been sold on a wholesale model, where the retailer pays the publisher about half the list price, then is free to set another price. The agency model prevented Amazon from sharply discounting the books.

Five publishers — the Penguin Group USA, the Hachette Book Group, Simon Schuster, HarperCollins and Macmillan — have already settled with the government. But Apple, intent on protecting Mr. Jobs’s legacy, is fighting the charges in a nonjury trial that was expected to last several weeks.

The defense was questioning Mr. Cue when the day ended and he will return to the stand when the trial continues on Monday.

Lawrence Buterman, a lawyer for the Justice Department, occasionally raised his voice while he questioned Mr. Cue for several hours before a packed courtroom presided over by Judge Denise L. Cote.

“Isn’t it true, sir, that throughout your negotiations with the publishers, that you constantly pitched the deal that you were proposing as a way for them to change the entire e-books market?” Mr. Buterman said.

“No, that is not true,” Mr. Cue said.

Mr. Buterman asked Mr. Cue about a previous statement by David Shanks, the chief executive of the Penguin Group USA, that Penguin would only sign a deal with Apple if three other major publishers had done so first.

“Did that strike you as a little bit like, ‘I’m only doing this deal if my competitors do it?’ “ Mr. Buterman said.

“It’s not unusual,” Mr. Cue said. “Nobody likes to be the first to sign. Everybody thinks that you get a better deal by signing last.”

According to Mr. Cue, Apple approached the negotiations with publishers the same way it did with record companies and other content providers in the iTunes store.

After Apple and other retailers started selling e-books on the agency model, prices on many best-selling and new books rose to the $12.99 to $14.99 range, infuriating many consumers.

David Shanks, the chief executive of Penguin Group USA, fought with Apple over the e-book pricing it initially proposed.

And Ms. Reidy called an executive at Paramount Pictures to verify Apple’s claim that a 30 percent commission on sales in their iTunes store — which she considered too high — was standard.

These actions were described in testimony this week as evidence that, rather than illegally conspiring to fix e-book prices, Apple and the publishers were locked in intense negotiations during December 2009 and January 2010. Again and again, Apple lawyers sought to portray the actions as normal business proceedings.

Mr. Shanks and Ms. Reidy echoed that theme, saying the negotiations with Apple were much like those with other retailers, a push-and-pull series of talks that forced them to demand concessions and make some of their own.

Mr. Shanks and Ms. Reidy were the first publishers to take the stand in Federal District Court in Manhattan in the civil antitrust trial stemming from the lawsuit filed last year by the Justice Department.

The publishers, which have all settled with the government, are not on trial. But the proceedings have provided a glimpse into the state of the book business during the period several years ago when Apple decided to enter the e-book market to coincide with the introduction of the iPad.

Lawyers for the Justice Department have argued that the publishers not only used Apple as a conduit to communicate with each other, but also had conversations in which they shared information about Apple and its competitor, Amazon, the dominant force in e-books.

They have repeatedly pressed publishing executives this week on the phone calls and e-mails they exchanged, the private dinners they attended and their conversations at industry events, interactions that, according to the government, are evidence that the publishers were engaged in a conspiracy to raise prices on e-books.

When Apple entered the e-book market, it did so under the so-called agency model, in which publishers set prices for e-books and the retailer takes a 30 percent commission. At the time, publishers sold e-books to other retailers under a wholesale model, where publishers charged retailers close to half the cover price for a book, and the retailers set their own prices.

Amazon, which controlled 90 percent of the e-book market, had set the default price of most new and best-selling books at $9.99, a price that publishers felt undervalued their books and cannibalized hardcover sales. Eager for another big competitor in the e-book market, all six publishers engaged in talks with Apple.

It was during that time, the government said, that the publishers and Apple illegally colluded, eventually forcing Amazon to adopt the agency model as well.

Lawrence Buterman, a lawyer for the Justice Department, questioned Ms. Reidy on Wednesday about her conversation with Brian Murray, the chief executive of HarperCollins, while Mr. Murray was trying to move Amazon to the agency pricing model.

Mr. Buterman also asked her about a conversation with John Sargent, the chief executive of Macmillan, a fellow publisher, during which the two talked about Amazon.

Ms. Reidy shrugged it off. “I made some crack about the personalities at Amazon,” she said.

Mr. Buterman pointed to phone logs that showed several phone calls between Ms. Reidy and David Young, then the chief executive of Hachette. Ms. Reidy said she did not remember all of the calls.

Ms. Reidy, displaying occasional flashes of impatience and sarcasm during several hours of testimony, repeatedly deflected the government’s suggestion that the most-favored-nation clause imposed the agency model on other retailers. The most-favored clause is a provision in the publishers’ contracts with Apple requiring that no other retailer sell e-books for a lower price.

Later, under questioning by Daniel Floyd, a lawyer for Apple, Ms. Reidy said she initially resisted the most-favored nation clause, but eventually agreed to include it.

Mr. Shanks, testifying on Tuesday, said he was not able to convince Apple to eliminate price caps of $12.99 and $14.99 on its e-books.

Ms. Reidy said she also opposed the price caps, but relented and allowed them to be written into the contract.

The antitrust trial, which is expected to take about three weeks, is presided over by Judge Denise L. Cote.

After the Justice Department filed a lawsuit against Apple and five publishers last year, the Hachette Book Group, Simon Schuster, and HarperCollins settled immediately; Macmillan and Penguin agreed months later to settle. Penguin and Random House, two of the biggest publishers in the business, are expected to complete a merger in July.

Ms. Reidy provided the most embarrassing moment of the day when an e-mail from her to Mr. Moonves was projected onto a large screen. In the e-mail, Ms. Reidy updated Mr. Moonves, the chief executive of CBS, which owns Simon Schuster, on her talks with Apple. She referred to an Apple executive as a “minion.”