Mattel Inc , the world's largest toy company, reported a bigger-than-expected fall in gross margins, as it spent more on making, packaging and transporting its toys, sending its shares down 4 percent.

Toymakers are fighting to shield their margins from a rise in the cost of raw materials like plastics and paper, and higher wages demanded by laborers in China, where a lot of U.S. companies make their toys.

Additionally, Mattel, the maker of Barbie dolls and Hot Wheels toys, said a rise in the U.S. dollar against foreign currencies like the euro in September pulled down gross margins by about 180 basis points.

Gross margins in the quarter fell to 47.8 percent from 51.1 percent in the year-ago period, weighing on the company's profit, even as sales rose across its line of toys.

While its margins fell, the strong sales performance bodes well for Mattel as it heads into the crucial holiday season in the face of stiff competition from Hasbro Inc and MGA.

Mattel's closely awaited toys this holiday season include Angry Birds Knock On Wood, a tabletop version of the highly popular game app for mobile phones, and the Monster High Dead Tired doll line that features offspring of famous monster characters themed on a pajama party.

Third-quarter net income was $300.8 million, or 86 cents a share, compared with $283.3 million, or 77 cents a share, a year ago.

Net sales rose 9 percent to $2.0 billion. Barbie sales were up 17 percent in the quarter. Sales of Other Girls Brands, which include the Monster High and Disney Princess doll lines, were up 32 percent.

Analysts, on average, had expected earnings of 86 cents a share, before special items, on revenue of $1.97 billion, according to Thomson Reuters I/B/E/S.

The company also increased its stock repurchase program by $500 million.

Mattel's shares, which have risen 9 percent this year in contrast to a 27 percent fall in rival Hasbro, were down 4 percent at $26.68 on Friday morning on Nasdaq.

(Reporting by Mihir Dalal in Bangalore; Editing by Sriraj Kalluvila and Saumyadeb Chakrabarty)