* Britain due to leave EU in 24 days
* UK's biggest foreign policy shift in decades
* May's team seeks changes to Irish ‘backstop’
* British parliament deeply divided

Prime Minister Theresa May's top government lawyer heads to Brussels on Tuesday, a last-ditch bid to secure changes to a Brexit deal needed to get the agreement through parliament and smooth Britain's departure from the European Union.

Britain is due to leave the EU in 24 days, but parliament's rejection of May's deal earlier this year has put in doubt how, when or possibly even if Britain's biggest foreign and trade policy shift in more than 40 years wil take place.

May has charged her team, Attorney General Geoffrey Cox and Brexit minister Stephen Barclay, with securing changes to the so-called Irish backstop, an insurance policy to prevent the installation of a ‘hard border’ between the British province of Northern Ireland and EU member Ireland if a future trading relationship falls short.

Cox and Barclay will meet the EU's chief negotiator Michel Barnier and other officials from the bloc on Tuesday, hoping to build on what May's team call ‘progress’ in talks to find a compromise that would completely rule out Britain leaving without a deal, a nightmare scenario for many businesses.

‘We all want to leave at the end of this month and it depends how quickly we can get a deal through,’ foreign minister Jeremy Hunt told BBC radio, describing the situation as having been ‘transformed in a positive direction’ over the last month.

‘Our ask of the EU is an important ask ... but it is one ask and it's a simple one. We need substantive changes that will allow the attorney general to change his advice to the government that says that, at the moment, theoretically, we could be trapped in the backstop indefinitely.’

May has struggled to convince the EU that she can get the deal through a deeply divided parliament in London, where lawmakers are increasingly flexing their muscles to try to influence Britain's departure from the bloc.

She has already offered lawmakers the chance to seek to prevent a departure without a deal and to delay Brexit if parliament rejects the deal in a vote she has promised to hold by March 12. Both British and EU officials have said that any delay would not be lengthy, probably for a few months.

Ministers are hoping that Cox, a successful senior private lawyer, can convince eurosceptic lawmakers that he has done enough to remove the threat of Britain ending up in the EU's customs union indefinitely - something Brexit supporters say would make a mockery of the 2016 vote to leave the bloc.

The British government had been looking at either an end date on the provision or some way of London being able to stop the arrangement unilaterally, but have in recent days been less specific about what the changes would amount to.

One minister said the change would most probably come in an addendum to the agreement - something, the government hopes, will be enough to change minds in parliament, where deep divisions over Brexit have become increasingly entrenched.

‘How we get there is something we're prepared to be flexible about,’ Hunt said. ‘But the crucial thing that we are looking for is to see whether Geoffrey Cox is going to be able to change his advice to the government.’