If you send a Limit Order that is a buy order with a limit higher than the current best ask price, then it will get immediately executed in an amount up to what is at or better than the limit price.
Similarly, if you send a sell order that has a limit below the current best bid price the same will happen.
Any balance of your order that cannot be completed will rest on the order book at the limit price.