MSPs unanimously approved the bills relating to children's rights and local government last month.
But UK ministers are concerned the legislation could place obligations on them and, if so, would be beyond the scope of Holyrood's devolved powers.
The UK government is referring both to the UK Supreme Court for a ruling.
It means they will not receive royal assent, which allows them to become laws, until the UK's highest court has considered the challenge.
One of the bills incorporates the European Charter of Local Self-Government into Scots law, while the other seeks to incorporate the incorporate the UN Convention on the Rights of the Child (UNCRC).
After every bill is passed by the Scottish Parliament there is a four-week period where the UK government can consider whether to use powers in the Scotland Act 1998 to challenge the planned law.
Nicola Sturgeon has described the challenge as "jaw dropping".
In a tweet, the first minister added: "The UK Tory government is going to court to challenge a law passed by the Scottish Parliament unanimously.
"And for what? To protect their ability to legislate/act in ways that breach children's rights in Scotland.
"Politically catastrophic, but also morally repugnant."
But a UK government source said: "This delay to the legislation could easily have been avoided.
"Sadly, it appears the Scottish government are more interested in stirring a constitutional row than getting the UNCRC bill into law at the first opportunity."
A UK government spokesman said: "The UK government law officers' concerns are not about the substance of the legislation, rather whether parts are outwith the legislative competence of the Scottish Parliament."
To challenge the scope of Holyrood's law-making powers in the middle of an election campaign is a politically explosive decision by the UK government.
The timing was not entirely in their gift because the Scottish Parliament's decision to pass the two bills last month created a four-week window for them to consider action.
One UK government source told me the legal challenge was "regrettable" but "avoidable" if the Scottish government had listened to their concerns and made some changes.
The UK government insists it has no objection to the policy content of the bills, only to their potential to limit UK decision making in Scotland - which would be beyond Holyrood's powers.
An SNP source said changes were not required because the bills had passed the scrutiny of both Scottish government and Scottish Parliament lawyers.
Each side accuses the other of picking this fight. It will now be for the UK Supreme Court to settle - a process that will put the legislation on hold and fuel the constitutional debate in the Holyrood election campaign.
The best argument against democracy is a five-minute conversation with the average voter.