Mattis will still need to be confirmed by the Senate, which is expected Friday afternoon.
Cameras rolled as Trump signed his first orders as President in the Capitol, surrounded by congressional leaders.
According to Spicer, the other papers Trump was signing included formal nominations for his Cabinet and a proclamation for a national day of patriotism.
The ceremony took place moments after Trump left the podium outside the Capitol building where he was sworn in and delivered his inaugural address.
As is customary, Trump used a series of pens to sign the measures, then distributed the pens among the people gathered. Presidential signing pens are regularly given out as commemorative gifts to politicians or individuals touched by the action.
The moment played out on live television as Trump offered his first pen to the Democrats around him, first House Minority Leader Nancy Pelosi and then Senate Minority Leader Chuck Schumer, who hails from New York and has long known Trump.
The mood was jovial, as Trump, surrounded by family, joked with congressional leaders. He, Pelosi and Schumer talked about trading pens as Pelosi remarked that hers came from the nominating papers of Georgia Rep. Tom Price.
Price, up for Health and Human Services, is being strongly opposed by Democrats, who have attacked him on policy and called for an investigation into some of his stock trades, which Price defended before the Senate committee holding his confirmation hearing this week.
Trump offered Pelosi the pen from the paper he was signing instead, that of transportation secretary nominee Elaine Chao.
Pelosi demurred, with Trump giving the pen to Chao’s husband, Senate Majority Leader Mitch McConnell.
The Senate will begin voting on Trump’s Cabinet on Friday afternoon, but is only expected to confirm two nominees that day — Mattis and retired Gen. John Kelly, up for Homeland Security.
The remaining nominees are expected to receive debate, hearings and votes in coming days.