On its 12th and final day — a cool, dry, glorious day — the Minnesota State Fair welcomed a record crowd for the second day in a row, the fair reported Tuesday.

164,277 people came to the fair Monday, a record for 12th-day attendance. On Sunday, also a cool day, 236,197 came through the fair gates, setting a record not just for 11th-day attendance, but for single-day attendance throughout the fair’s history.

The weekend’s really big crowds followed a midweek slump attributed to very hot, humid weather. Total attendance for this year was 1,731,162, fair officials said. That’s slightly less than last year’s total, 1,788,512. The all-time record for total fair attendance was set in 2009, when 1,790,497 people came through the gates.

The fair’s attendance numbers day by day:

• Thursday, Aug. 22: 106,852, compared to 103,738 last year. (The record was 119,145, set in 2010.)

• Friday, Aug. 23: 121,941, compared to 117,040 last year. (The record was 132,738, set in 2010.)

• Saturday, Aug. 24: 170,986, compared to 152,646 last year. (The record was 202,126, set in 1998.)

• Sunday, Aug. 25: 145,706, compared to 185,485 last year. (The record was 209,969, set in 1994.)

• Monday, Aug. 26: 102,935, compared to 133,781 last year. (The record was 143,998, set in 1994.)

• Tuesday, Aug. 27: 94,076, compared to 121,097 last year. (The record was 129,423, set in 2009.)

• Wednesday, Aug. 28: 116,348, compared to 118,193 last year. (The record was 128,966, set in 2006.)

• Thursday, Aug. 29: 117,480, compared to 101,379 last year. (The record was 155,183, set in 1995.)

• Friday, Aug. 30: 158,164, compared to 164,694 last year. (The record was 179,052, set in 2003.)

• Saturday, Aug. 31: 196,200, compared to 226,863 last year. (The record was 234,384, set in 2010.)

• Sunday, Sept. 1: 236,197 — an all-time single-day record. 210,836 people attended the fair on its last Sunday in 2012.

• Monday, Sept. 2: 164,277 — a record for last-day attendance. 152,760 people attended the fair on Labor Day 2012.

• Total attendance; 1,731,162 this year, compared to 1,788,512 last year. The all-time record for total fair attendance was 2009’s 1,790,497.