* SPD due to announce cabinet posts on Friday
* Gabriel loses out in SPD shake-up
* SPD has six posts in new "grand coalition" (Adds detail on Maas, environment minister)
By Madeline Chambers and Holger Hansen
BERLIN, March 8 (Reuters) - Germany's Justice Minister Heiko Maas is to become foreign minister in Chancellor Angela Merkel's new coalition government, a source in his Social Democratic (SPD) party said.
Maas, 51, introduced ambitious laws in his previous job that forced social media companies such as Facebook and Twitter to remove hate speech from their sites.
The law was seen as an international test case but is set to be amended in response to criticism that too much content is being blocked.
He is also a vocal critic of the far-right Alternative for Germany (AfD), racist crime and anti-Semitism. He introduced a law to rehabilitate and compensate thousands of gay men prosecuted and jailed under an arcane German law.
The party source confirmed reports in Spiegel Online and Bild daily among others, and followed a statement from Sigmar Gabriel, who has held the post for the last year, who said he did not have a job in the new government.
Merkel's conservatives and the SPD have agreed that the party will retain control of the foreign ministry in their "grand coalition" and the party is due to officially announce its six cabinet ministers on Friday.
The party declined to comment on the reports about Maas, a Catholic from Saarland on the French border, who was one of the front runners.
The post of top diplomat is crucial as Germany, still haunted by the legacy of its Nazi past, gradually takes on a more assertive international role to match its economic might.
However, most commentators expect Merkel to keep a grip on ties with the United States, Russia, China and the EU as it negotiates Brexit and euro zone reform.
Gabriel's exit was no surprise as he had tense relations with Andrea Nahles, expected to become SPD leader in April. She and interim SPD leader Olaf Scholz told him he would not be part of the government due to be sworn in next week, said Gabriel.
"If it's true that he will be the new foreign minister then (I) have a very good feeling - (Maas) will do it excellently," he said at a news conference with his Bosnian counterpart.
The SPD is expected to split cabinet jobs evenly between men and women and there is pressure to have a representative from the former Communist East.
Acting SPD leader Scholz is set to become finance minister . The other ministries the SPD can fill are labour, justice, family and environment.
Bild reported that Katarina Barley, 49, family minister since 2017, would become labour minister and Franziska Giffey, from Berlin, would replace her.
One senior SPD member said Svenja Schulze, 49, from North Rhine-Westphalia, would become environment minister, after incumbent Barbara Hendricks said she would be leaving.
Merkel's Christian Democrats and Bavarian Christian Social Union allies have already announced their choices of cabinet ministers.
Parliament is due to elect Merkel for her fourth term as chancellor of Europe's biggest economy on Wednesday, nearly six months after an election in which her conservatives and the SPD bled support to the AfD. (Additional reporting by Michelle Martin Writing by Madeline Chambers Editing by Matthew Mpoke Bigg)