Let \( x \) represent the number of games Ahmadullah's basketball team played last season. According to the problem, the number of games played this season, which is 21, is 12 games more than \( \frac{1}{3} \) of the games played last season.
We can set up the equation as follows:
\[ 21 = \frac{1}{3} x + 12 \]
To solve for \( x \), first, subtract 12 from both sides:
\[ 21 - 12 = \frac{1}{3} x \] \[ 9 = \frac{1}{3} x \]
Next, multiply both sides by 3 to isolate \( x \):
\[ 9 \times 3 = x \] \[ x = 27 \]
So, the team played 27 games last season.
Therefore, the answer is:
27 games