Yes.
A firm maximizes profit when the following three conditions are satisfied.
1. The market price, p, is equal to the marginal cost.
2. The marginal cost is nondecreasing.
3. In the short run, the market price must be greater than or equal to the average variable cost. In the long run, the market price must be grater than or equal to the average cost.