LOS ANGELES, California (CNN) -- Troubled pop star Britney Spears will be allowed to spend more time with her sons under modified custody arrangements agreed upon at a hearing Tuesday, said attorneys for Spears' ex-husband, Kevin Federline.
Although an order giving Federline custody of 2-year-old Sean Preston and 1-year-old Jayden James remains in place, attorney Mark Vincent Kaplan said Spears' time with the children will gradually be extended.
He said that Federline is pleased with the agreement and that he and his attorneys feel that Spears has stabilized in the months after two hospitalizations this year.
"I think that consistency over time with respect to structure and stability is something that would be welcomed by Kevin and, I'm sure, recognized by the court at the appropriate time," Kaplan said.
"The children are doing great. I think they're doing really great. That's the key question, and that's what all this is about."
Watch Federline's attorney discuss the case »
A court spokesman read a statement from Spears' parents, Jamie and Lynne, which said they are pleased with their daughter's progress and with the outcome of the hearing.
Timeline: Britney Spears in the news »
Spears, 26, has had a long-running custody battle with Federline over the children. She arrived at court Tuesday flanked by her parents, wearing a brown polka-dot dress. She arrived within a few minutes of Federline, who wore a cream-colored suit.
The hearing was closed to the press within minutes of its beginning at the request of Spears' attorneys.
Spears' parents obtained a restraining order against her manager in February, accusing Osama "Sam" Lutfi -- whom Spears met in October -- of drugging her and controlling her life, her finances and her exposure to photographers. The order barred Lutfi from Spears' homes and those of her family, as well as her children.
Spears' father was given conservatorship of her earlier this year. Her visitation rights to the children were previously suspended after her odd behavior and hospitalizations but have since been restored.
In the past year, the onetime Mouseketeer shaved her head as photographers looked on; been cited for "habitual, frequent, and continuous use of controlled substances and alcohol" by the judge in her custody case; and seen her "comeback" performance on the MTV Video Music Awards panned by critics who derided her singing, dancing, costume choice and weight.

But she recently made a well-received guest appearance on the television show "How I Met Your Mother."
The next court date in the custody case is set for July 15, court officials said.
CNN's Jack Hannah contributed to this report.
All About Britney Spears
| Most Viewed | Most Emailed | Top Searches |