Q:

Find the minimum force that has to be applied to the block $m_1$ so that the other block just begins to slide

This is a problem from the book 'Problems in General Physics' by I E Irodov. Two blocks of masses $m_1$ and $m_2$ are placed on a rough horizontal surface, connected by a light spring.
Find the minimum constant force that has to be applied on the block with mass $m_1$ so that the other block just begins to slide.
Consider the limiting case: 
Suppose the spring has compression $x$ by that time. Block  $m_2$ is just about to move.
We can write, $$kx=\mu m_2 g$$
And, by the work energy theorem 
$$Fx-0.5kx^2-\mu m_1 gx- \mu m_2gx= 0.5m_1 v^2$$
For the system of $m_1$, $m_2$ and the spring.
This is where I am stuck. According to the answer, the force required is minimum when $v=0$. 
Why is the block $m_1$ at rest in the limiting case? I cannot find any suitable justification for this, neither an intuitive explanation. Also, is something wrong with my Work Energy theorem expression?

A:

For second block
$$\mu m_2g=kx$$
For first block
$$F.x-\frac12kx^2-\mu m_1gx=\frac12m_1v^2$$
Set $v=0$
$$F=\frac12kx+\mu m_1g=\mu g(m_1+\frac{m_2}2)$$

Why is the block $m_1$ at rest in the limiting case? I cannot find any suitable justification for this, neither an intuitive explanation. 

No, it is not at rest, it will have moved some distance x, which I don't know how you unknowingly accounted in the W-E Theorem even after you said it is at rest.
Firstly, block one will start to move from rest when applied force becomes greater than the limiting friction on block 1, parallely the force of spring increases, when both the frictional force on block 2 and the spring force on block 2 becomes equal the block 2 starts moving.
The maximum possible extension of the spring will occur when the mass$ m_1$ can no longer move and starts to move back due to the action of the spring. At this point $v=0$

Also, is something wrong with my Work Energy theorem expression?

Yes you shouldn't account frictional work for block 2 because it has not started moving, it is just going to move, it hasn't covered any distance so no frictional work has been done on it. 
Even if you wrote W-E Theorem for block 2 [suppose after it has started to move], then you are uncertain that block 1 and 2 covered the same distance x.Even if you wanted to find the distances covered individually, consider their motion with respect to the centre of mass of the system [assume spring to be massless.]

