The race for seat has been neck and neck with Mr Sharma leading the sitting MP by 2572 votes on Monday morning.
Dr Phelps, who won the seat in a byelection in October, said it had been an «enormous privilege to represent the electorate of Wentworth».
She listed the removal of children from Nauru and medical transfers from offshore detentions as her proudest achievements.
«We showed that one voice can make a difference,» Dr Phelps said.
«I knew when I entered the House of Representatives it could be either for seven months or perhaps many years.»
But she said the «sensible centre» would be more important than ever in Australian politics and she was concerned about the «lurch of the Liberals and Nationals to the right».
«I believe there is still a cry for socially progressive politics,» Dr Phelps said.
A source close to Dr Phelps said it was a disappointing result because the Liberals poured money into the seat «while refusing to put their candidate up for any forums or debates».
Dr Phelps said the campaign had been «very trying and difficult», referring to a series of racist and homophobic emails that had circulated around the electorate.
The emails are being investigated by NSW Police’s counter terrorism unit and are believed to have originated from one person. Dr Phelps has said her opponents had nothing to do with the emails.
Mr Sharma has 51.67 per cent of the vote on a two-party preferred basis while Dr Phelps has 48.33 per cent with about 76 per cent of the vote counted.
Mr Sharma, the former ambassador to Israel, was confident he could claw back the seat for the Liberals after Dr Phelps wrestled it from the party after the dumping of ex-Liberal prime minister Malcolm Turnbull.
He will make a statement last this afternoon.
Alexandra Smith is the State Political Editor of The Sydney Morning Herald.