According to the ideal gas law the pressure P, volume V, amount of substance n and temperature of a gas are related as P*V = n*R*T, where R is a universal constant.
As a gas is compressed, work is being done on the gas. The result of the work is first a decrease in its volume with the temperature not being affected. Once the gas has reached a volume where it cannot be compressed further into a smaller volume, we have the parameters V, n and R in the equation taking on constant values. This reduces the equation to P = k*T. Now temperature is directly proportional to the pressure.
As the gas is compressed, the work put into the system goes to increasing the temperature of the gas.