Abstract An algorithm is presented that probabilistically computes the exact inverse of a nonsingular n × n integer matrix A using O˜(n 3 (log ||A|| + log κ(A))) bit operations. Here, ||A|| = max ij |A ij | denotes the largest entry in absolute value, κ(A) := ||A −1 || ||A|| is the condition number of the input matrix, and the soft-O notation O˜indicates some missing log n and log log ||A|| factors. A variation of the algorithm is presented for polynomial matrices. The inverse of any nonsingular n × n matrix whose entries are polynomials of degree d over a field can be computed using an expected number of O˜(n 3 d) field operations. Both algorithms are randomized of the Las Vegas type: fail may be returned with probability at most 1/2, and if fail is not returned the output is certified to be correct in the same running time bound