Parvin Ahmadinejad, a sister of the president and a current member of Tehran's municipal council, was defeated by a conservative rival in their hometown of Garmsar. She only lost by 728 votes, which would indicate that she did have considerable support - albeit not enough to defeat her rival.
Her failure is seen as a big blow to Mr Ahmadinejad in the first balloting since his disputed re-election in 2009. Conservative rivals of the president were leading in the race for parliament according to early election results on Saturday in an indication he may face a more hostile house in the remaining 18 months of his second term in office.
The strong showing by loyalists of Supreme Leader Ayatollah Ali Khamenei in Friday's parliamentary elections also reflected staunch support for Iran's theocracy and its firm stance in the nuclear standoff with the West.