Sporting a Mohawk but dressed in a crisp suit, Kevin Federline arrived at an L.A. County courthouse at around 9 a.m. on Jan. 14 ready to get down to business: maintaining sole legal and physical custody of his sons Preston, 2, and Jayden, 16 months. Testifying in an all-day hearing centering on his ex-wife Britney Spears' Jan. 3 standoff at her Studio City, Calif., home, Federline had a calm focus. "When you're honest and believe in the need to go forward, it takes a lot of anxiety out of the process of testifying before a court," says his lawyer Mark Vincent Kaplan. "He's a pretty cool customer."

The same can hardly be said of Spears, who appeared outside the courthouse around 1:30 but abruptly left after paparazzi swarmed her. (Unlike Federline, she did not use the specially secured underground parking.) "I'm scared. I want to get in the car. I'm going in the car," a clearly rattled Spears, 26, told photographers. While Federline addressed the court inside the hushed, closed hearing that afternoon, Spears led the paparazzi pack on a series of destinations—first the Little Brown Church in Studio City (where she stopped inside briefly) and then on to lunch at the nearby Gaucho Grill—looking dispirited all the while. At Gaucho Grill—accompanied by photographer boyfriend Adnan Ghalib, friend Sam Lutfi and Lutfi pal Chad Hardcastle—"Britney was very quiet and seemed sad and upset," says a waitress. (As for a report that Spears had written a suicide note on the night of her meltdown, "there was no suicide note, and it's completely untrue that she tried to commit suicide," Lutfi tells PEOPLE. "She is not suicidal.")

In the end the court maintained Federline's sole custody of the boys, with no visitation for Spears indefinitely. (The ex-couple's next hearing is set for Feb. 19, but they could return to court earlier if either party requests an emergency hearing.) Meanwhile, Preston and Jayden remained far from the day's turmoil, going for a sunny stroll with their longtime nanny near Federline's Tarzana, Calif., home—where they are likely to remain for the foreseeable future.

The outing is just the sort of low-key activity the boys have come to expect under their dad's care. Already a father when he began dating Spears—he has kids Kori, 5, and Kaleb, 3, with ex Shar Jackson—Federline, 29, has confidently stepped into the role of primary caregiver to Preston and Jayden. "Kevin is an all-around great dad," says his friend DJ Irie. "For most guys in Kevin's situation, home would be the ultimate bachelor pad. But for Kevin, he made it all about the kids: He's got toys everywhere. You can totally tell it's all about the kids at home."

That may come as a surprise to those who remember him as a would-be rapper and frequent Vegas partier during his marriage to Spears. But friends of Federline—who's now appearing on the CW drama One Tree Hill—bristle at any suggestion that he has transformed overnight into a candidate for Dad of the Year (as Details magazine recently anointed him). "It makes me furious when people say, 'Oh, great—he's taking responsibility,'" says one pal. "He's always been a great father. He's been there in every way for all of his kids." In fact he shares custody of Kori and Kaleb with Jackson, 31, and all four kids have spent time together. "He's just happy that the boys are safe," says Jackson. "That's his biggest thing, making sure that the boys are happy."

Also in support of K-Fed's paternal instincts: Britney's mom, Lynne, who has spent time with her grandsons at his home. "The children are very well taken care of," says a friend of Lynne's. "Kevin has an excellent nanny. I've met her—she's wonderful." With regular bedtimes (usually by 8) and nap times, "the children are on a schedule. All of that is good."

In addition to the boys' nanny, Federline relies on a tight circle that includes his bodyguard Lonnie Jones, a Sunday school teacher on weekends; his mom, Julie, who visits from Fresno; and his dad, Mike, and stepmom Collette, who live in nearby Orange County. "They're always at Kevin's house or with Shar and her kids," says a source close to Federline. "They're a very close-knit family."

It's the same type of bond Federline hopes to continue building with his sons—particularly at a time when they may need it most. "He can't replace their mother in their life, but ... he is committed to trying to fill any void by being there at all times," says Kaplan. As Federline himself says in next month's Interview magazine, "Being a father is No. 1. Family comes first.... Becoming a father has shown me how little I am and how big my kids are. It has shown me that everything you think about as a single person or as a bachelor or whatever—none of that means nothing when your child comes along."

  • Contributors:
  • Bryan Alexander/Los Angeles,
  • Howard Breuer/Los Angeles,
  • Pernilla Cedenheim/Los Angeles,
  • Ken Lee/Los Angeles,
  • Mary Margaret/Los Angeles,
  • Ruth Laney/Baton Rouge.