Former political staffer James Ashby is to pursue the federal government for more than $1 million in legal costs from his aborted sexual harassment suit against former parliamentary speaker Peter Slipper.

In a Federal Court hearing on Monday, the bitter legal stoush – in which Mr Ashby accused his former boss of "unwelcome sexual advances" – was formally discontinued following Mr Ashby’s decision to withdraw from the case last week.

James Ashby has dropped his case against Peter Slipper but will pursue the government to pay his $1 million-plus legal bill. Credit:Nic Walker

However, Mr Ashby’s barrister, Tom Blackburn, SC, asked that his client be given the option of making an application for costs from the federal government.

The case spanned more than two years, covered numerous court hearings and produced thousands of pages of legal documents, so Mr Ashby's legal costs were expected to be in excess of $1 million.