In his complaint, Mr. Ayanna cited a “macho” culture that “encourages male associates and partners to fulfill the stereotypical male role of ceding family responsibilities to women.”

At the firm, he noted in the complaint, the partner he reported to repeatedly “made derisive comments about Ayanna’s taking care of his wife and children” after he came back from leave, even though there was no evidence that he had missed deadlines or his work had suffered in any way.

Also in 2013, the Transportation Department settled a complaint from Gary M. Ehrhard, an air traffic controller who claimed that the federal agency had engaged in sex discrimination when it denied him several days of child care leave that it granted to mothers in 2007. Mr. Ehrhard said the agency retaliated when he complained about this treatment by, among other things, requiring him to present a medical note when absent because of illness.

The cases come against the backdrop of a societal shift in which many fathers are working less and spending more time with their children. A recent Pew Research Center analysis reported that from 1965 to 2011, fathers reduced the number of hours they devoted to paid work to about 37 from 42 each week on average and increased the number of hours they devoted to child care each week to about seven from 2.5.

The earlier cases that have been settled appear to have encouraged more fathers to seek legal remedies. Rebecca G. Pontikes, who represented Mr. Ayanna, said she had received inquiries from other lawyers. “They talk to me about bringing suits they have on behalf of male caregivers,” she said. “It has not been without effect.”

Even companies that have adopted legally defensible official policies may still face legal action. In a study reported this year in the journal Organization Science, Erin Reid, an assistant professor of organizational behavior at Boston University, who gained access to workers in a large consulting firm, uncovered numerous instances in which fathers were discouraged from adjusting their schedules to accommodate parental responsibilities, coupled with a kind of disbelief that they would even entertain the idea.

“Men experienced more overt discrimination, hostility,” Professor Reid said.

David Reina, a lawyer who took paternity leave once at a prominent New York firm and a second time at a firm in Washington, said it was implicitly conveyed to senior associates of both genders that if they wanted to make partner they should not take the full leave: In both cases it was four weeks for parents who were not the primary caregiver (typically men) and roughly 18 weeks for women who were primary caregivers.