Step 1: Name the present ages.
Let B's present age be $x$. Since A is now twice B, A's present age is $2x$.
Step 2: Step back five years.
Five years ago A was $2x - 5$ and B was $x - 5$.
Step 3: Use the past condition.
At that time A was three times B: \[ 2x - 5 = 3(x - 5) \]
Step 4: Expand and simplify.
\[ 2x - 5 = 3x - 15 \]
Step 5: Solve for $x$.
Bringing terms together gives $10 = x$, so B is $10$ now.
Step 6: Find A's present age.
A is $2x = 2 \times 10 = 20$, and a check confirms five years ago $15 = 3 \times 5$.
\[ \boxed{30 \text{ years}} \]