Voting was extended three times as crowds reportedly flocked to polling stations. Turnout was said to be high.
Iranians have been electing a new parliament and Assembly of Experts, a clerical body that appoints the Supreme Leader.
Reformists are hoping to gain influence in the conservative-dominated bodies.
But of 12,000 people who registered as candidates, only half were allowed to stand, including  just 200 moderates.
The outcome could affect reformist President Hassan Rouhani's chances of re-election in 2017.
What is the Assembly of Experts?
Iran elections: Five things to know
Elections highlight divisions
Punchy politics on social media
Supreme Leader Ayatollah Ali Khamenei called for a big turnout to "disappoint" the country's enemies.
"Whoever likes Iran and its dignity, greatness and glory should vote," he said after casting his ballot.
State TV said polling stations had closed at 23:45 (20:15 GMT), more than five hours after the scheduled closing time of 18:00.
The parliamentary elections are to choose 290 MPs for four-year terms.
Voters will also select 88 clerics to the Assembly of Experts, who serve eight-year terms.
Members of the new Assembly might end up choosing the successor to Ayatollah Khamenei, who is 76 and has suffered ill-health.
Some 55 million people were eligible to vote.
BBC Persian's Ali Hamedani says the economy has been a key issue in this election.
With sanctions lifted and Western investors beginning to return to Iran, there are high hopes for an improvement in daily life, he says.
Reformists and moderates say they are targeting greater foreign investment which, our correspondent says, will drive jobs for young people.
More than half of Iranians are under 35 but the youth unemployment rate is 25%, more than two and a half times the national average.
However, conservatives say strong economic growth is more likely to come from domestic production in what they describe as a "resistance economy" that draws on the ideals of the country's 1979 Islamic Revolution.
Results for the Assembly of Experts are expected over the weekend.
The results of the parliamentary election could take longer and it is likely to go to a second round in April.
Candidates need 25% of the vote to win outright and there are an average of 17 candidates per seat.

"All-lane running" has been introduced between junction 10a for Wolverhampton and junction 13 for Stafford.
When trialled on the M25 near London, it "reduced congestion and led to more reliable journeys", said Highways England.
Lay-bys are replaced by emergency refuge areas - but some organisations say there are not enough of them.
The Central Motorway Police Group said the lack of lay-bys was "cause for concern" and there was "minimal scrutiny" of the scheme on the M6.
Edmund King, president of the AA said: "Laybys are every two and half kilometres - that is about one and a half miles.
"If you can't see a lay-by you have to stop in a live lane of traffic and that is so dangerous."
Matt Dallaway from the RAC said all-lane running as a concept was fine but he was concerned safety had not been tested.
MP's on the Commons Transport Committee have launched an inquiry.
Highways England said: "Our motorways are some of the safest in the world and the evidence shows collision and casualty rates on the M25 are down."
"As we gradually roll out these upgrades on other motorways we will continue to work closely with all the emergency services so we can ensure safety is maintained."
All-lane running is currently being installed on the M5 between junctions 4a for Bromsgrove and 6 Worcestershire North.
Polls have closed in Iran's first election since a deal with world powers over the country's nuclear programme and the lifting of sanctions.
[NEXT_CONCEPT]
A scheme allowing motorists to drive on the hard shoulder of the M6 is "dangerous," motoring groups have said.